Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCOptions ¶
type GRPCOptions struct {
BindAddress string `mapstructure:"bind-address"`
BindPort int `mapstructure:"port"`
MaxMsgSize int `mapstructure:"max-msg-size"`
}
GRPCOptions are for creating an unauthenticated, unauthorized, insecure port. No one should be using these anymore.
func NewGRPCOptions ¶
func NewGRPCOptions() *GRPCOptions
NewGRPCOptions is for creating an unauthenticated, unauthorized, insecure port. No one should be using these anymore.
func (*GRPCOptions) AddFlags ¶
func (s *GRPCOptions) AddFlags(fs *pflag.FlagSet)
AddFlags adds flags related to features for a specific api server to the specified FlagSet.
func (*GRPCOptions) Validate ¶
func (s *GRPCOptions) Validate() []error
Validate is used to parse and validate the parameters entered by the user at the command line when the program starts.
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 server 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 server 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 LogOptions ¶
type LogOptions struct {
OutputPath string `mapstructure:"output-path"`
FileName string `mapstructure:"file-name"`
Level zlog.Level `mapstructure:"level"`
Format string `mapstructure:"format"`
ServiceName string `mapstructure:"service-name"`
}
func NewLogOptions ¶
func NewLogOptions() *LogOptions
func NewZoomApiLogOptions ¶
func NewZoomApiLogOptions() *LogOptions
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-level"`
}
MySQLOptions defines options for mysql database.
func NewMySQLOptions ¶
func NewMySQLOptions() *MySQLOptions
NewMySQLOptions create a `zero` value instance.
func (*MySQLOptions) AddFlags ¶
func (o *MySQLOptions) AddFlags(fs *pflag.FlagSet)
AddFlags adds flags related to mysql storage for a specific APIServer to the specified FlagSet.
func (*MySQLOptions) NewClient ¶
func (o *MySQLOptions) NewClient() (*gorm.DB, error)
NewClient create mysql store with the given config.
func (*MySQLOptions) Validate ¶
func (o *MySQLOptions) Validate() []error
Validate verifies flags passed to MySQLOptions.
type RedisOptions ¶
type RedisOptions struct {
Host string `json:"host" mapstructure:"host" description:"Redis service host address"`
Port int `json:"port"`
Addrs []string `json:"addrs" mapstructure:"addrs"`
Username string `json:"username" mapstructure:"username"`
Password string `json:"password" mapstructure:"password"`
Database int `json:"database" mapstructure:"database"`
MasterName string `json:"master-name" mapstructure:"master-name"`
MaxIdle int `json:"optimisation-max-idle" mapstructure:"optimisation-max-idle"`
MaxActive int `json:"optimisation-max-active" mapstructure:"optimisation-max-active"`
Timeout int `json:"timeout" mapstructure:"timeout"`
EnableCluster bool `json:"enable-cluster" mapstructure:"enable-cluster"`
UseSSL bool `json:"use-ssl" mapstructure:"use-ssl"`
SSLInsecureSkipVerify bool `json:"ssl-insecure-skip-verify" mapstructure:"ssl-insecure-skip-verify"`
}
RedisOptions defines options for redis cluster.
func NewRedisOptions ¶
func NewRedisOptions() *RedisOptions
NewRedisOptions create a `zero` value instance.
func (*RedisOptions) AddFlags ¶
func (o *RedisOptions) AddFlags(fs *pflag.FlagSet)
AddFlags adds flags related to redis storage for a specific APIServer to the specified FlagSet.
func (*RedisOptions) Validate ¶
func (o *RedisOptions) Validate() []error
Validate verifies flags passed to RedisOptions.
type ServerRunOptions ¶
type ServerRunOptions struct {
Mode string `mapstructure:"gin-mode"`
Healthz bool `mapstructure:"healthz"`
Middlewares []string `mapstructure:"middlewares"`
Port int `mapstructure:"port"`
Address string `mapstructure:"bind-address"`
}
ServerRunOptions contains the options while running a generic api server.
func NewServerRunOptions ¶
func NewServerRunOptions() *ServerRunOptions
NewServerRunOptions creates a new ServerRunOptions object with default parameters.
func (*ServerRunOptions) ApplyTo ¶
func (s *ServerRunOptions) ApplyTo(c *server.Config) error
ApplyTo applies the run options to the method receiver and returns self.
func (*ServerRunOptions) Validate ¶
func (s *ServerRunOptions) Validate() []error
Validate checks validation of ServerRunOptions.
type StoreOptions ¶
type StoreOptions struct {
Driver string `mapstructure:"driver"`
}