Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 12:04

    kataras on v12.2.0-alpha3

    (compare)

  • 11:59

    kataras on master

    v12.2.0-alpha3 (compare)

  • 11:50

    kataras on master

    minor (compare)

  • 11:28

    kataras on master

    replace optimized json encoder … (compare)

  • Sep 14 19:10

    kataras on master

    update dependencies (compare)

  • Sep 14 18:50

    kataras on master

    minor (compare)

  • Sep 14 18:40

    kataras on master

    Create SECURITY.md (compare)

  • Sep 14 18:24

    kataras on master

    Create codeql-analysis.yml (compare)

  • Sep 14 18:22

    kataras on master

    fix: add go.mod and go.sum to a… Merge pull request #1800 from n… (compare)

  • Sep 14 18:22
    kataras closed #1800
  • Sep 14 18:21

    kataras on master

    fix macos panic dereferencing w… remove extra newline Merge pull request #1805 from K… (compare)

  • Sep 14 18:21
    kataras closed #1805
  • Sep 14 18:19
    kataras closed #1813
  • Sep 07 15:28

    kataras on master

    update the kataras/tunnel depen… (compare)

  • Sep 02 12:44
    renxiaotu review_requested #1813
  • Sep 02 12:44
    renxiaotu opened #1813
  • Aug 12 12:12
    Kimbsen opened #1805
  • Aug 12 12:12
    Kimbsen review_requested #1805
  • Jul 31 02:20
    nanikjava review_requested #1800
  • Jul 31 02:20
    nanikjava opened #1800
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?
Sourav pandit
@BusinessOcean
Hi all any one faced issue with grpc tls: first record does not look like a TLS handshake
Sourav pandit
@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 ?
snowlyg
@snowlyg
@Laotanling 我有个 qq 交流群欢迎进群交流 676717248
V Rao
@VRao72_twitter
when using iris-cli, it is failing to compile on windows system because of bindata.go having windows paths in strings that are considering as unknown escape sequence characters
could not move further using iris-cli
Any help on this is greatful, and I can proceed further to use iris and can be active member
Mubariz Ahmed
@mubariz-ahmed
@kataras waiting on the email for book, kindly check the contact email, I have attached relevant reference for payments. Thanks.
Vũ Hoàng Lâm
@lamvh_gitlab
@kataras i found an issue on your refresh token example
refreshToken := []byte(ctx.URLParam("refresh_token"))
    if len(refreshToken) == 0 {
        // You can read the whole body with ctx.GetBody/ReadBody too.
        var tokenPair jwt.TokenPair
        if err := ctx.ReadJSON(&tokenPair); err != nil {
            ctx.StopWithError(iris.StatusBadRequest, err)
            return
        }

        refreshToken = tokenPair.RefreshToken
    }

    // Verify the refresh token, which its subject MUST match the "currentUserID".
    _, err := verifier.VerifyToken(refreshToken, jwt.Expected{Subject: currentUserID})
    if err != nil {
        ctx.Application().Logger().Errorf("verify refresh token: %v", err)
        ctx.StatusCode(iris.StatusUnauthorized)
        return
    }
if refreshToken acquired by ctx.URLParam, it is a raw refresh token []byte
but if refreshToken acquired by ctx.ReadJSON, its wrapped by doublequotes and cant be use as a parameter for VerifyToken
Vũ Hoàng Lâm
@lamvh_gitlab
it's take me 2 hours to debug my production application XD
NewTokenPair method is not convenient as u think imo
John Kinyanjui
@JohnKinyanjui
Which library should i use for postgress