Help us shape the future of Go! Take the 2026 Go Developer Survey

webutil

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2023 License: MIT Imports: 9 Imported by: 0

README

webutil

Web-related utilities for Go microservices.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureGinCORS

func ConfigureGinCORS(
	router *gin.Engine,
	allowedOrigins []string,
	allowMethods []string,
	allowHeaders []string,
	exposeHeaders []string,
	maxAge time.Duration,
	disableCredentials bool)

func GinAccessLogMiddleware

func GinAccessLogMiddleware(c *gin.Context)

func InitGinPackage

func InitGinPackage(devMode bool)

func NewGin

func NewGin() *gin.Engine

Types

type CORSConfig

type CORSConfig struct {
	AllowedOrigins     []string      `` /* 241-byte string literal not displayed */
	AllowMethods       []string      `` /* 219-byte string literal not displayed */
	AllowHeaders       []string      `` /* 258-byte string literal not displayed */
	DisableCredentials bool          `` /* 216-byte string literal not displayed */
	ExposeHeaders      []string      `` /* 215-byte string literal not displayed */
	MaxAge             time.Duration `` /* 215-byte string literal not displayed */
}

func (*CORSConfig) Configure

func (c *CORSConfig) Configure(router *gin.Engine)

type HTTPConfig

type HTTPConfig struct {
	Port int        `env:"PORT" value-name:"PORT" long:"port" description:"Port to listen on" default:"8000"`
	CORS CORSConfig `group:"cors" namespace:"cors" env-namespace:"CORS"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL