Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 23 22:49

    kataras on master

    thank you @mattbowen for your k… (compare)

  • Jan 23 22:43

    kataras on master

    thank you @always-waiting for y… (compare)

  • Jan 23 03:14

    kataras on master

    README: minor (compare)

  • Jan 23 01:52

    kataras on master

    Update README_ZH.md Merge pull request #1707 from w… (compare)

  • Jan 23 01:52
    kataras closed #1707
  • Jan 23 01:52

    kataras on master

    udpate modifyProxiedRequest Merge pull request #1710 from t… (compare)

  • Jan 23 01:52
    kataras closed #1710
  • Jan 21 17:17
    tuhao1020 edited #1710
  • Jan 21 17:15
    tuhao1020 review_requested #1710
  • Jan 21 17:15
    tuhao1020 opened #1710
  • Jan 21 03:57

    kataras on master

    Add example for #1706 (we alrea… (compare)

  • Jan 21 03:25

    kataras on master

    update host.ProxyHandler to com… update TestProxy add ProxyHandlerRemote and NewP… and 1 more (compare)

  • Jan 21 03:25
    kataras closed #1703
  • Jan 20 23:41

    kataras on master

    README: minor (compare)

  • Jan 20 23:36

    kataras on master

    Expose the ConfigureContainer()… (compare)

  • Jan 20 22:42

    kataras on master

    Thanks @lpintes for your kind d… (compare)

  • Jan 20 12:18
    poppyred review_requested #1709
  • Jan 20 12:18
    poppyred opened #1709
  • Jan 19 05:40
    wuyc review_requested #1707
  • Jan 19 05:40
    wuyc opened #1707
Arsene Tochemey Gandote
@Tochemey
Hello folks. Please I would like to know whether I can get a good example on how to implement a gRPC based app with iris. I know how to do it without iris.
Gerasimos (Makis) Maropoulos
@kataras
@focusonline We can install master
with success, are you sure you followed the steps? Relative to: kataras/iris#1691
Hello @Tochemey if you already know how to do it without Iris, then you don't have to change your gRPC code at all just follow this or/and that
Servio Zambrano
@fenriz07
Hello, where can I download the electronic book, I have completed the donation and I did not receive any email.
Gerasimos (Makis) Maropoulos
@kataras
Hello @fenriz07 please check your github's e-mail or navigate to the notifications, you must see a pending invitation to the iris-premium private repository, there you can find the pdf as many things more :)
Servio Zambrano
@fenriz07
Hello, Thanks :)
Arsene Tochemey Gandote
@Tochemey
@kataras Thanks for the reply. QQ: any advice or suggestions how to handle gRPC interceptors?
sunchangjiang
@sunchangjiang
How to report a security issue for IRIS framework?
Dragan
@escugs
@sunchangjiang I think msg the kataras directly. ( PM ) or email him at iris-go@outlook.com.
raroldan
@raroldan
Hi all, I don't know if it's me doing something wrong but there seems to be an issue using the middleware.jwt.aliases, for example, the Claims type. If I reference that one instead of the one from kataras/jwt, the compiler complains :'(
Actually, sorry about that, it's not the compiler complaining, it's the GoLand IDE :S
Dragan
@escugs
@raroldan i think GoLand have reindex and option to pull it in mod file. Is their red light bob that will reindex packet that is missing. ( That works for me )
raroldan
@raroldan
@escugs Many thanks: File > Invalidate Caches solved it ;)
Massimiliano Bertinetti
@maxbertinetti
@kataras if you are interested I have a PR ready to push for iris-contrib/svelte-template.
I’ve updated dependencies and added frontend livereload!
Deepak Prabhakara
@deepakprab_twitter
Hi folks, I am getting the following error running iris - go: github.com/kataras/iris/v12@v12.2.0-alpha requires gopkg.in/yaml.v3@v3.0.0-20200615113413-eeeca48fe776/go.mod: verifying module: gopkg.in/yaml.v3@v3.0.0-20200615113413-eeeca48fe776/go.mod: cannot authenticate record data in server response. Any idea how to sort the issue?
Deepak Prabhakara
@deepakprab_twitter

Hi folks, I am getting the following error running iris - go: github.com/kataras/iris/v12@v12.2.0-alpha requires gopkg.in/yaml.v3@v3.0.0-20200615113413-eeeca48fe776/go.mod: verifying module: gopkg.in/yaml.v3@v3.0.0-20200615113413-eeeca48fe776/go.mod: cannot authenticate record data in server response. Any idea how to sort the issue?

^ Fixed by zapping the current GOPATH, looks like a local issue with go mod.

Gerasimos (Makis) Maropoulos
@kataras
Thanks @maxbertinetti, I've accepted your PR!
@deepakprab_twitter you did go clean --modcache ? If so, maybe we should add it to the installation's troubleshooting section.
Happy Holidays @/all 🎄🤶🎅
Massimiliano Bertinetti
@maxbertinetti

Happy Holidays @/all 🎄🤶🎅

🎄

Deepak Prabhakara
@deepakprab_twitter

@deepakprab_twitter you did go clean --modcache ? If so, maybe we should add it to the installation's troubleshooting section.

Hi @kataras , that's right. Adding it to installation's troubleshooting is a good idea. Nice work on iris, thanks :-).

刘旭
@liuxuzxx

Hi, @kataras when I use "Upload files", I found

app.Post("/upload", func(ctx iris.Context) {
        ...
        .......
        file, _, err:= ctx.FormFile("file")
        if err != nil {
            ctx.StopWithError(iris.StatusBadRequest, err)
            return
        }

        // Upload the file to specific destination.
       //the file does not have Filename property,
        dest := filepath.Join("./uploads", file.Filename)
        ctx.SaveFormFile(file, dest)

        ctx.Writef("File: %s uploaded!", file.Filename)
    })

the file does not have Filename property(use go1.15 version!),but the method ctx.FormFile("file") return result:fileHeader have the Filename property.So the document have some problem!

刘旭
@liuxuzxx

So the correct code is:

app.Post("/upload", func(ctx iris.Context) {
        // Set a lower memory limit for multipart forms (default is 32 MiB)
        ctx.SetMaxRequestBodySize(maxSize)
        // OR
        // app.Use(iris.LimitRequestBodySize(maxSize))
        // OR
        // OR iris.WithPostMaxMemory(maxSize)

        // single file
        file, fileHeader, err:= ctx.FormFile("file")
        if err != nil {
            ctx.StopWithError(iris.StatusBadRequest, err)
            return
        }

        // 这个地方应该使用fileHeader来获取文件名(go 1.15version).
       //我不知道是不是go的版本的问题,我没有去查看go之前的版本
        dest := filepath.Join("./uploads", fileHeader.Filename)
        ctx.SaveFormFile(file, dest)

        ctx.Writef("File: %s uploaded!", file.Filename)
    })

and the ctx.FormFile source code is:

func (ctx *Context) FormFile(key string) (multipart.File, *multipart.FileHeader, error) {
    // we don't have access to see if the request is body stream
    // and then the ParseMultipartForm can be useless
    // here but do it in order to apply the post limit,
    // the internal request.FormFile will not do it if that's filled
    // and it's not a stream body.
    if err := ctx.request.ParseMultipartForm(ctx.app.ConfigurationReadOnly().GetPostMaxMemory()); err != nil {
        return nil, nil, err
    }

    return ctx.request.FormFile(key)
}
刘旭
@liuxuzxx
I suddenly remembered, according to the time zone, it is late at night in the US
Mulyawan Sentosa
@mulyawansentosa
Hello
刘旭
@liuxuzxx
Hello
I am here
Gerasimos (Makis) Maropoulos
@kataras
Hello guys. Happy new year!
@liuxuzxx Yeah, you the one example we have at the iris-go.com/docs. That's fixed, thanks! The rest form file-relative examples (6+) are using the correct code.
Hello @mulyawansentosa and thanks for the donation :heart: I've added you to the iris-premium repository and the iris/premium gitter private chat room, please check your e-mails (or github/gitter notifications). Your name is also listed on iris-go.com and on our repository's README file.
刘旭
@liuxuzxx
@kataras Happy new year!
I saw it, now it's correct
Gerasimos (Makis) Maropoulos
@kataras

Hello Gophers!

A new tag pre-release of v12.2.0-alpha2 is available for you who don't like using @master :)

Massimiliano Bertinetti
@maxbertinetti
👍
ndimorle
@ndimorle
Sorry to bother! I'm new to iris; I requested the PDF version of the doc to learn more about it but did'nt receive it. Can you help?
Massimiliano Bertinetti
@maxbertinetti
@kataras will soon add you to the iris-premium repo
ndimorle
@ndimorle
Ok Thanks!
Gerasimos (Makis) Maropoulos
@kataras
Hello @ndimorle, sorry for the delay. You are in!
vuhoanglam
@vuhoanglam
"template 'page/sample.html' does not exist" is there anyway to handle view error right before it's occur? im writing a cms and trying use middleware to alter the view name before it's dispatch.
Massimiliano Bertinetti
@maxbertinetti
Sorry. I don’t really understand what you need exactly.
Can you try to explain better what you are doing and what you need? Maybe share some code @vuhoanglam
vuhoanglam
@vuhoanglam
i mean
view will throw an error "template x does not exist" if i pass a wrong view path
i want to catch this error then fall back to a default view
the view should provide more events to subscribe to
such as: AfterParsed, BeforeDispatch, etc
Massimiliano Bertinetti
@maxbertinetti

On a CMS sort of site I think you have a database entry for every pages and one or more template types associated and generated dinamically.

Another solution is to generate a static site based on Hugo and Netlify CMS, that for simple CMS is what I use today. It’s faster and simple to deploy.

vuhoanglam
@vuhoanglam
i want to create my own cms for researching purposes, and for better understanding Iris. I still think, iris should provide more built in events in the application lifecycle
Gerasimos (Makis) Maropoulos
@kataras

Hello @vuhoanglam,

The ctx.View returns an error. This error is always logged to your terminal screen (or log file) if the logger is not disabled.

If the application is running under debug log level (app.Logger().SetLevel("debug")) then the client will receive the error text too but if not (default behavior) then it just returns the error the caller, so you can catch it.

Example Code:

<!-- ./view/fallback.html -->
<h1>Fallback view of {{.ViewRequested}}</h1>
package main

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

const defaultViewName = "fallback"

func main() {
    app := iris.New()
    app.RegisterView(iris.HTML("./view", ".html"))
    app.Get("/", index)

    app.Listen(":8080")
}

func index(ctx iris.Context) {
    var viewName = "blabla"

    err := ctx.View(viewName)
    if err != nil {
        ctx.View(defaultViewName, iris.Map{
            "ViewRequested": viewName,
        })
    }
}

I assume you just want to render something as 'fallback' - that you can do already as shown above.

Now, if you are asking if you can disable this log line of "template x does not exist" then it's a different thing. We can create a config field in order to disable that message :)

Gerasimos (Makis) Maropoulos
@kataras
I can also put a feature of "fallback" view AND layouts of non-exist templates per handler or per Party and if that exists then the error log will be not shown up, otherwise it will, I think that's a better solution, do you agree?