options

package
v0.0.0-...-a39f72a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLOptions

type MySQLOptions struct {
	Host                  string        `json:"host,omitempty"`
	Username              string        `json:"username,omitempty"`
	Password              string        `json:"-"`
	Database              string        `json:"database"`
	MaxIdleConnections    int           `json:"maxidleconnections,omitempty"`
	MaxOpenConnections    int           `json:"maxopenconnections,omitempty"`
	MaxConnectionLifeTime time.Duration `json:"maxconnectionlifetime,omitempty"`
}

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 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"`
	Port                  int      `json:"port"`
	Addrs                 []string `json:"addrs"`
	Username              string   `json:"username"`
	Password              string   `json:"password"`
	Database              int      `json:"database"`
	MasterName            string   `json:"mastername"`
	MaxIdle               int      `json:"maxidle"`
	MaxActive             int      `json:"maxactive"`
	Timeout               int      `json:"timeout"`
	EnableCluster         bool     `json:"enablecluster"`
	UseSSL                bool     `json:"usessl"`
	SSLInsecureSkipVerify bool     `json:"sslinsecureskipverify"`
}

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) NewClient

func (r *RedisOptions) NewClient() *redis.Pool

func (*RedisOptions) Validate

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

Validate verifies flags passed to RedisOptions.

Jump to

Keyboard shortcuts

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