options

package
v0.0.0-...-93fcbcf Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtOptions

type JwtOptions struct {
	Realm      string        `json:"realm"       mapstructure:"realm"`
	Key        string        `json:"key"         mapstructure:"key"`
	Timeout    time.Duration `json:"timeout"     mapstructure:"timeout"`
	MaxRefresh time.Duration `json:"max-refresh" mapstructure:"max-refresh"`
}

JwtOptions contains configuration items related to API logicServer features.

func NewJwtOptions

func NewJwtOptions() *JwtOptions

NewJwtOptions creates a JwtOptions object with default parameters.

func (*JwtOptions) AddFlags

func (s *JwtOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags related to features for a specific api logicServer to the specified FlagSet.

func (*JwtOptions) ApplyTo

func (s *JwtOptions) ApplyTo(c *server.Config) error

ApplyTo applies the run options to the method receiver and returns self.

func (*JwtOptions) Validate

func (s *JwtOptions) Validate() []error

Validate is used to parse and validate the parameters entered by the user at the command line when the program starts.

type MySQLOptions

type MySQLOptions struct {
	Host                  string        `json:"host,omitempty" mapstructure:"host"`
	Username              string        `json:"username,omitempty" mapstructure:"username"`
	Password              string        `json:"-" mapstructure:"password"`
	Database              string        `json:"database" mapstructure:"database"`
	MaxIdleConnections    int           `json:"max-idle-connections,omitempty" mapstructure:"max-idle-connections"`
	MaxOpenConnections    int           `json:"max-open-connections,omitempty" mapstructure:"max-open-connections"`
	MaxConnectionLifeTime time.Duration `json:"max-connection-life-time,omitempty" mapstructure:"max-connection-life-time"`
	LogLevel              int           `json:"log-level" mapstructure:"log-lecel"`
}

func NewMySQLOptions

func NewMySQLOptions() *MySQLOptions

NewMySQLOptions 创建一个空值的MySQLOptions实例

func (*MySQLOptions) AddFlags

func (o *MySQLOptions) AddFlags(fs *pflag.FlagSet)

AddFlags 添加mysql的命令行参数

func (*MySQLOptions) NewClient

func (o *MySQLOptions) NewClient() (*gorm.DB, error)

NewClient 创建一个gorm的db实例

func (*MySQLOptions) Validate

func (o *MySQLOptions) Validate() []error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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