Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 27 21:11

    kataras on master

    Thanks @paulxu21 @DavidShaw @li… (compare)

  • Apr 22 11:00

    kataras on master

    New APIContainer.EnableStrictMo… (compare)

  • Apr 22 08:52

    kataras on master

    godoc: minor (compare)

  • Apr 13 18:11

    kataras on master

    Thanks @acdias for your kind do… (compare)

  • Apr 13 18:06

    kataras on master

    README: minor (compare)

  • Apr 13 18:03

    kataras on master

    fix bug: RWMutex not unlocked Merge pull request #1753 from o… (compare)

  • Apr 13 18:03
    kataras closed #1753
  • Apr 13 18:00

    kataras on master

    Thanks @rfunix and @liheyuan fo… (compare)

  • Apr 13 01:27
    o8x review_requested #1753
  • Apr 13 01:27
    o8x opened #1753
  • Apr 05 00:54
    jakieoymj-github closed #1750
  • Apr 05 00:52
    jakieoymj-github review_requested #1750
  • Apr 05 00:52
    jakieoymj-github opened #1750
  • Apr 04 17:24

    kataras on master

    add Party.RemoveRoute method as… (compare)

  • Apr 04 14:34

    kataras on master

    add Party.RemoveRoute method as… (compare)

  • Apr 04 14:28

    kataras on master

    add Party.RemoveRoute method as… (compare)

  • Apr 03 16:12

    kataras on master

    Thanks @RainerGevers and @shado… (compare)

  • Mar 26 12:28

    kataras on master

    Thanks @knavels, @rxrw, @rbondi… (compare)

  • Mar 25 10:38

    kataras on master

    Happy Greek Independence Day! (compare)

  • Mar 25 10:30

    kataras on master

    Thanks @wofka72 for your kind d… (compare)

vuhoanglam
@vuhoanglam
is there a way to naming the filerouters
Gerasimos (Makis) Maropoulos
@kataras

Hello @vuhoanglam, you can do it from the donate form, from https://iris-go.com. Thanks :heart: .

Yes you can name file routers. The HandleDir method returns a slice of []*Route. Each *Route has a Name property, just modify it to your preffered onces.

frans
@dafa168
Docs : Upload files -- Single file , method: ctx.SaveFormFile(file, dest) not found ?
odiferousmint
@odiferousmint
Hello. When I build my executable and run it, it tells me I have installed an invalid version. It tells me to install it with go get -u github.com/kataras/iris/v12@latest so I ran that and it was successful. I built the executable again, re-ran, and I got the same warning/error. It asks me if I want to autofix it. I went for it, and I get [FTAL] 2021/02/05 02:18 autofix: replace import paths: open /tmp/foo/test: text file busy. test here is the executable that gave me this warning and asked me if I want to autofix. How can I fix it manually or workaround this issue?
odiferousmint
@odiferousmint
This is what I get:
$ ./test
You have installed an invalid version. Install with:
        go get -u github.com/kataras/iris/v12@latest

        If your Open Source project depends on that pre-go1.9 version please open an issue
        at https://github.com/kataras/iris/issues/new and share your repository with us,
        we will upgrade your project's code base to the latest version for free.

        If you have a commercial project that you cannot share publically, please contact with
        @kataras at https://chat.iris-go.com. Assistance will be provided to you and your colleagues
        for free.

Run autofix? (Y/n): y
[INFO] 2021/02/05 02:18 Backup </tmp/foo> to </tmp/foo_irisbckp.zip>
[INFO] 2021/02/05 02:18 Updating...
[FTAL] 2021/02/05 02:18 autofix: replace import paths: open /tmp/foo/test: text file busy
I am not entirely sure what it is trying to do with the executable or why. Is there any other way to run this autofix perhaps?
odiferousmint
@odiferousmint
Ah, I fixed it, never mind it. I just had to fix the imports.
odiferousmint
@odiferousmint

If I had

app := iris.Default()
app.StaticWeb("/css", "./website/assets/css")

then what would be its equivalent in the latest version of iris?

Massimiliano Bertinetti
@maxbertinetti
Gerasimos (Makis) Maropoulos
@kataras
Hello @odiferousmint, it's actually app.HandleDir("/css", "./website/assets/css") (the first input parameter now is an interface{} which can accept string and http.FileSystem, there is a third optional parameter which is the iris.DirOptions - you can configure the static file server).
Hello @dafa168 , SaveFormFile exists. Please make sure you follow the Installation guide (go get github.com/kataras/iris/v12@master).
qilx
@qilx
Please is there any documentation for v12 version? It seems that https://www.iris-go.com/docs/ is for master branch.
qilx
@qilx
Anybody tried to write custom tag parser for pongo2 and register it in view.DjangoEngine? I have problems to write Execute(ctx, w) function.
qilx
@qilx
IT seems like view package is missing type aliases for pongo2.ExecutionContext and pongo2.TemplateWriter.
qilx
@qilx
Is it possible to disable removing of trailing slashes?
Alex Rojo
@arojoal
Hi is there a way to get the full url of a route?
I need to get the full url of a route in order to include it as a value in a response json
qilx
@qilx
I guess you can get it from c.Request().URL
tuhao1020
@tuhao1020
@arojoal if you have a query string, you can use ctx.FullRequestURI() + "?" + ctx.Request().URL.RawQuery
tuhao1020
@tuhao1020
@kataras can app.Get run in other go routines?
Business Ocean
@BusinessOcean
Hi all any one faced issue with grpc tls: first record does not look like a TLS handshake
Business Ocean
@BusinessOcean

@kataras Still stuck in above issue unable to run grpc example .I am very new backend development. Tnx

here i am getting issue . if i try to change the port 443 to some thing else api won't work . if i request with 443 getting tls handshake fail issue

i followed https://github.com/kataras/iris/tree/master/_examples/mvc/grpc-compatible link

iulo
@iulo
Hi guys. do mw have any upgrade docs from v11 to v12 ?
Vũ Hoàng Lâm
@lamvh_gitlab
hey guys, in your personal opinion, should I use mvc feature?
Wang Weiming
@will-beta
app.ConfigureContainer() undefined in v12. Could anyone help?
Wang Weiming
@will-beta
also, iris.APIContainer is not found in v12.
Gerasimos (Makis) Maropoulos
@kataras
@will-beta go get -u github.com/kataras/iris/v12@master
bikashpdash
@bikashpdash
Hii I want to start a project in go is iris is good for large projects
Navid Dezashibi
@knavels
@bikashpdash yes it worth trying and seeing it by yourself in action, it does have good implementation and good structure to start, be sure to check the documentation out
Wang Weiming
@will-beta
@kataras It works. Thanks a lot. But why it is necessary? Neither go get -u github.com/kataras/iris/v12@latest nor go mod tidy can not solve the problem.
John Deng
@binghan.deng_gitlab
@kataras I would like to set status code in the custom middleware after the main handler is finished according to the result that returned from the main handler, I tried below example and changed a litter bit. However, it does not work. can you or someone else help me on this issue?
package main

import (
    "log"
    "time"

    "github.com/kataras/iris/v12"
)

func main() {
    app := iris.New()

    app.Use(Filter())

    booksAPI := app.Party("/books")
    {

        // GET: http://localhost:8080/books
        booksAPI.Get("/", list)
        // POST: http://localhost:8080/books
        booksAPI.Post("/", create)
    }

    app.Listen(":8080")
}

// Book example.
type Book struct {
    Title string `json:"title"`
}

func list(ctx iris.Context) {
    books := []Book{
        {"Mastering Concurrency in Go"},
        {"Go Design Patterns"},
        {"Black Hat Go"},
    }

    ctx.JSON(books)
    // TIP: negotiate the response between server's prioritizes
    // and client's requirements, instead of ctx.JSON:
    // ctx.Negotiation().JSON().MsgPack().Protobuf()
    // ctx.Negotiate(books)
    ctx.StatusCode(403)
}

func Filter() iris.Handler {
    return func(ctx iris.Context) {
        t := time.Now()

        // Set a shared variable between handlers
        ctx.Values().Set("framework", "iris")

        // before request

        ctx.Next()

        // after request
        latency := time.Since(t)
        log.Print(latency)

        // access the status we are sending
        status := ctx.GetStatusCode()
        log.Println(status)

        // How to set the status code according to the final result?
        // e.g. if err != nil {
        ctx.StatusCode(403)
    }
}

func create(ctx iris.Context) {
    var b Book
    err := ctx.ReadJSON(&b)
    // TIP: use ctx.ReadBody(&b) to bind
    // any type of incoming data instead.
    if err != nil {
        ctx.StatusCode(iris.StatusInternalServerError)
        return
    }

    println("Received Book: " + b.Title)

    ctx.StatusCode(iris.StatusCreated)
}
Zhenwei Liu
@zhenwei12138
test
hello
Vũ Hoàng Lâm
@lamvh_gitlab
go get github.com/iris-contrib/swagger/v12@master always pull old version which outdated compare to the document
Wu JingFeng
@iwujingfeng
I love iris!
Arsene Tochemey Gandote
@Tochemey
Hello folks. Please is there a doc on how to use logrus with iris
devBash99
@devBash99
Is there a http request type module/wrapper to make external requests in iris.
Arsene Tochemey Gandote
@Tochemey
I have a request suggestion to make. Using the grpc feature of iris requires that one should use TLS which I don't think it should be enforced on the developer because depending upon the infrastructure of a company you may no need a TLS to run a gRPC service. The choice should be let to the developer to make
Every gRPC library out there makes it optional to use so I think iris should follow that trend.
qikong333
@qikong333
请问发中文会不会不好
ctx.StopWithError undefined (type context.Context has no field or method StopWithError)

import (
"path/filepath"

"github.com/kataras/iris/v12"

)

module aaa

go 1.16

require (
    github.com/kataras/iris/v12 v12.1.8
    github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
)
why undefined??
12.18 Is it not included?
qikong333
@qikong333
The problem has been solved. Thank you
Version of the problem
Tan
@Laotanling
I Had pay the 8€,but not received emai of the book
Gerasimos (Makis) Maropoulos
@kataras
@Laotanling Please check your e-mails and your github notifications, you have been invited to the kataras/iris-premium repository. The process is NOT done automatically, please be pattient at general.
Tan
@Laotanling
@kataras ,thank you very much ,i had received the email of the book,i really appreciate it , i had one question , in the old version ,we can you use websocket.Config{} to config websocket about pingperiod、pongTimeout and so on , in the lastest version v12 ,how to config ?