flags

package
v0.0.0-...-8366d43 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBFlag

type DBFlag struct {
	Driver   sqlx.DBDriver `long:"driver" description:"Database driver to use for SQL backend (e.g. mysql, postgres, in-memory)" required:"true"`
	Host     string        `long:"host" description:"Host for SQL backend"`
	Port     int           `long:"port" description:"Port for SQL backend"`
	Schema   string        `long:"schema" description:"Database name to use for connecting to SQL backend"`
	Username string        `long:"username" description:"Username to use for connecting to SQL backend"`
	Password string        `long:"password" description:"Password to use for connecting to SQL backend"`

	TLS    SQLTLSFlag    `group:"TLS" namespace:"tls"`
	Tuning SQLTuningFlag `group:"Tuning" namespace:"tuning"`
}

func (*DBFlag) Connect

func (o *DBFlag) Connect(ctx context.Context, logger logx.Logger) (*sqlx.DB, error)

func (*DBFlag) IsInMemory

func (o *DBFlag) IsInMemory() bool

type LagerFlag

type LagerFlag struct {
	LogLevel LogLevel `` /* 134-byte string literal not displayed */
}

func (LagerFlag) Logger

func (f LagerFlag) Logger(component string) logx.Logger

type LogLevel

type LogLevel string
const (
	LogLevelDebug LogLevel = "debug"
	LogLevelInfo  LogLevel = "info"
	LogLevelError LogLevel = "error"
	LogLevelFatal LogLevel = "fatal"
)

type SQLTLSFlag

type SQLTLSFlag struct {
	Required bool                   `long:"required" description:"Require TLS connections to the SQL backend"`
	RootCAs  []ioutilx.FileOrString `long:"root-ca" description:"CA certificate(s) for TLS connection to the SQL backend"`
}

type SQLTuningFlag

type SQLTuningFlag struct {
	ConnMaxLifetime time.Duration `long:"connection-max-lifetime" description:"Limit the lifetime of a SQL connection" default:"0"`
}

Jump to

Keyboard shortcuts

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