beans

package
v0.0.0-...-a1208dc Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinLogger

func GinLogger(log *nlog.NLog, ginName string) gin.HandlerFunc

Types

type GinBean

type GinBean struct {
	framework.ConfigLoader
	// Configs
	IP      string `name:"ip" usage:"Server bind ip" default:"0.0.0.0"`
	Port    int    `name:"port" usage:"Server port" default:"8080"`
	Debug   bool   `name:"debug" usage:"Debug mode"`
	LogPath string `name:"logpath" usage:"Gin Log path"`
	GinBeanConfig
	*gin.Engine
}

func (*GinBean) Init

func (*GinBean) RegisterGroup

func (b *GinBean) RegisterGroup(groupRouters *router.GroupRouters)

func (*GinBean) RegisterRouter

func (b *GinBean) RegisterRouter(router *router.Router)

func (*GinBean) Start

func (*GinBean) Validate

func (b *GinBean) Validate(errs *errorcode.Errs)

type GinBeanConfig

type GinBeanConfig struct {
	Logger          *nlog.NLog
	ReadTimeout     *int
	WriteTimeout    *int
	IdleTimeout     *int
	MaxHeaderBytes  *int
	TLSServerConfig *TLSServerConfig
}

type MetricsBean

type MetricsBean struct {
	framework.ConfigLoader
	// Configs
	Port   int  `name:"port" usage:"Metrics port - use default gin port when not set"`
	Enable bool `name:"enable" usage:"Metrics enable" default:"true"`
	// contains filtered or unexported fields
}

func (*MetricsBean) Init

func (*MetricsBean) Start

func (*MetricsBean) Validate

func (b *MetricsBean) Validate(errs *errorcode.Errs)

type TLSServerConfig

type TLSServerConfig struct {
	CACert     *x509.Certificate
	ServerCert *x509.Certificate
	ServerKey  *rsa.PrivateKey
}

Jump to

Keyboard shortcuts

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