Arquivo da tag: golang

Certificado com o IRIS

package main

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

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

	app.Get("/", func(ctx context.Context) {
		ctx.Writef("Hello from the SECURE server")
	})

	// start the server (HTTPS) on port 443
	app.Run(iris.TLS("127.0.0.1:443", "mycert.cert", "mykey.key"))
}
https://chekun.me/post/iris-from-scratch-02-listen-and-configuration/

Share and Enjoy !

0Shares
0 0 0

Building Command Line Interfaces using Go

https://medium.com/swlh/building-command-line-interfaces-using-go-ce6a75d60bf5

Share and Enjoy !

0Shares
0 0 0

golang Iris – function to view

 // Default template funcs are:
    //
    // - {{ urlpath "myNamedRoute" "pathParameter_ifNeeded" }}
    // - {{ render "header.html" }}
    // and partial relative path to current page:
    // - {{ render_r "header.html" }} 
    // - {{ yield }}
    // - {{ current }}
    // Register a custom template func:
    tmpl.AddFunc("greet", func(s string) string {
        return "Greetings " + s + "!"
    })
https://github.com/kataras/iris/wiki/View

Share and Enjoy !

0Shares
0 0 0

A Go port of Ruby’s dotenv library (Loads environment variables from `.env`.)

Share and Enjoy !

0Shares
0 0 0