Documentation
¶
Index ¶
- func Bind(v *viper.Viper)
- func SetDefaults(v *viper.Viper)
- type Column
- type Config
- type GCSBConfig
- type Generator
- type Operations
- type Pool
- type Range
- type Table
- type TableConfigColumn
- type TableConfigGenerator
- type TableConfigGeneratorRange
- type TableConfigOperations
- type TableConfigTable
- type Validate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaults ¶
SetDefaults takes a viper instance and sets default configuration values
Types ¶
type Column ¶
type Config ¶
type Config struct { Project string `mapstructure:"project" yaml:"project"` Instance string `mapstructure:"instance" yaml:"instance"` Database string `mapstructure:"database" yaml:"database"` Threads int `mapstructure:"threads" yaml:"threads"` NumConns int `mapstructure:"num_conns" yaml:"num_cons"` MaxExecutionTime time.Duration `mapstructure:"max_execution_time" yaml:"max_execution_time"` Operations Operations `mapstructure:"operations" yaml:"operations"` Pool Pool `mapstructure:"pool" yaml:"pool"` Tables []Table `mapstructure:"tables" yaml:"tables"` // contains filtered or unexported fields }
type GCSBConfig ¶
type GCSBConfig struct { Database string `yaml:"database"` Project string `yaml:"project"` Instance string `yaml:"instance"` Tables []TableConfigTable `yaml:"tables"` }
func NewGCSBConfigFromPath ¶
func NewGCSBConfigFromPath(configPath string) (*GCSBConfig, error)
func (*GCSBConfig) DBName ¶
func (c *GCSBConfig) DBName() string
func (*GCSBConfig) GetCreateStatements ¶
func (c *GCSBConfig) GetCreateStatements() []string
func (*GCSBConfig) ParentName ¶
func (c *GCSBConfig) ParentName() string
func (*GCSBConfig) ReadConfig ¶
func (c *GCSBConfig) ReadConfig(configPath string) error
type Generator ¶
type Operations ¶
type Operations struct { Total int `mapstructure:"total" yaml:"total"` Read int `mapstructure:"read" yaml:"read"` Write int `mapstructure:"write" yaml:"write"` SampleSize float64 `mapstructure:"sample_size" yaml:"sample_size"` ReadStale bool `mapstructure:"read_stale" yaml:"read_stale"` Staleness time.Duration `mapstructure:"staleness" yaml:"staleness"` PartialKeys bool `mapstructure:"partial_keys" yaml:"partial_keys"` }
func (*Operations) Validate ¶
func (o *Operations) Validate() error
type Pool ¶
type Pool struct { MaxOpened int `mapstructure:"max_opened" yaml:"max_opened"` MinOpened int `mapstructure:"min_opened" yaml:"min_opened"` MaxIdle int `mapstructure:"max_idle" yaml:"max_idle"` WriteSessions float64 `mapstructure:"write_sessions" yaml:"write_sessions"` HealthcheckWorkers int `mapstructure:"healthcheck_workers" yaml:"healthcheck_workers"` HealthcheckInterval time.Duration `mapstructure:"healthcheck_interval" yaml:"healthcheck_interval"` TrackSessionHandles bool `mapstructure:"track_session_handles" yaml:"track_session_handles"` }
type Range ¶
type Range struct { Begin *interface{} `mapstructure:"begin"` // Begin for ranges like ranged string & date End *interface{} `mapstructure:"end"` // End of ranges like ranged string & date Length *int `mapstructure:"length"` // Length for generators like string or bytes Static *bool `mapstructure:"static"` // Static value indicator for bool generator Value *interface{} `mapstructure:"value"` // Value for static generation Minimum *interface{} `mapstructure:"minimum"` // Minimum for numeric generators Maximum *interface{} `mapstructure:"maximum"` // Maximum for numeric generators }
type TableConfigColumn ¶
type TableConfigColumn struct { Name string `yaml:"name"` Type string `yaml:"type"` Generator TableConfigGenerator `yaml:"generator"` }
type TableConfigGenerator ¶
type TableConfigOperations ¶
type TableConfigTable ¶
type TableConfigTable struct { Name string `yaml:"name"` RowCount int `yaml:"row_count"` Columns []TableConfigColumn `yaml:"columns"` Operations TableConfigOperations `yaml:"operations"` PrimaryKey string `yaml:"primary_key"` }
func (*TableConfigTable) GetColumnNamesString ¶
func (c *TableConfigTable) GetColumnNamesString() string
func (*TableConfigTable) GetCreateStatement ¶
func (c *TableConfigTable) GetCreateStatement() string
Click to show internal directories.
Click to hide internal directories.