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 (*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
Click to show internal directories.
Click to hide internal directories.