Documentation ¶
Index ¶
- func ConsoleErr(cmd *cobra.Command, str string)
- func ConsoleRun(runner RunCmd, workerType string, ui UI, cmd *cobra.Command, args []string)
- func DatastoreBytesToValues(input []byte) (map[string]string, error)
- func DatastoreLoad(conf *DatastoreConfig, ds Datastore, rv *Result) error
- func DatastoreRun(conf *DatastoreConfig, ds Datastore, rv *Result) error
- func DatastoreValuesToBytes(values map[string]string) ([]byte, error)
- func DatastoreWork(ds Datastore, rv *Result) error
- func HasPort(s string) bool
- type BasicConfig
- func (conf *BasicConfig) AddFlags(flags *flag.FlagSet)
- func (conf *BasicConfig) GetBasicConfig() *BasicConfig
- func (conf *BasicConfig) GetDatastoreConfig() *DatastoreConfig
- func (conf *BasicConfig) GetEtcdConfig() *EtcdConfig
- func (conf *BasicConfig) GetHttpConfig() *HttpConfig
- func (conf *BasicConfig) GetSwiftConfig() *SwiftConfig
- func (conf *BasicConfig) Validate() error
- type ConfigGetter
- type Datastore
- type DatastoreConfig
- type DatastoreObj
- type EtcdConfig
- type HttpConfig
- type Result
- type ResultArchiveReader
- type ResultArchiveWriter
- type RunCmd
- type SwiftConfig
- type UI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsoleErr ¶
func ConsoleRun ¶
func DatastoreLoad ¶
func DatastoreLoad(conf *DatastoreConfig, ds Datastore, rv *Result) error
func DatastoreRun ¶
func DatastoreRun(conf *DatastoreConfig, ds Datastore, rv *Result) error
func DatastoreWork ¶
Types ¶
type BasicConfig ¶
func (*BasicConfig) AddFlags ¶
func (conf *BasicConfig) AddFlags(flags *flag.FlagSet)
func (*BasicConfig) GetBasicConfig ¶
func (conf *BasicConfig) GetBasicConfig() *BasicConfig
func (*BasicConfig) GetDatastoreConfig ¶
func (conf *BasicConfig) GetDatastoreConfig() *DatastoreConfig
func (*BasicConfig) GetEtcdConfig ¶
func (conf *BasicConfig) GetEtcdConfig() *EtcdConfig
func (*BasicConfig) GetHttpConfig ¶
func (conf *BasicConfig) GetHttpConfig() *HttpConfig
func (*BasicConfig) GetSwiftConfig ¶
func (conf *BasicConfig) GetSwiftConfig() *SwiftConfig
func (*BasicConfig) Validate ¶
func (conf *BasicConfig) Validate() error
type ConfigGetter ¶
type ConfigGetter interface { // TODO(pquerna): This interface sucks. IT REALLY SUCKS. FIX ME. GetBasicConfig() *BasicConfig GetDatastoreConfig() *DatastoreConfig GetHttpConfig() *HttpConfig GetEtcdConfig() *EtcdConfig GetSwiftConfig() *SwiftConfig Validate() error }
type Datastore ¶
type Datastore interface { Config() ConfigGetter Insert(table string, key string, value DatastoreObj) error Read(table string, key string) (DatastoreObj, error) Update(table string, key string, value DatastoreObj) error Scan(table string, startKey string, count int) ([]DatastoreObj, error) Delete(table string, key string) error }
type DatastoreConfig ¶
type DatastoreConfig struct { Mode string Records int64 AtRecord int64 FieldCount int FieldSize int ReadRatio float64 UpdateRatio float64 }
func (*DatastoreConfig) AddFlags ¶
func (conf *DatastoreConfig) AddFlags(flags *flag.FlagSet)
func (*DatastoreConfig) GetDatastoreConfig ¶
func (conf *DatastoreConfig) GetDatastoreConfig() *DatastoreConfig
func (*DatastoreConfig) Validate ¶
func (conf *DatastoreConfig) Validate() error
type DatastoreObj ¶
type EtcdConfig ¶
type EtcdConfig struct {
BasicConfig
}
func (*EtcdConfig) GetEtcdConfig ¶
func (conf *EtcdConfig) GetEtcdConfig() *EtcdConfig
func (*EtcdConfig) Validate ¶
func (conf *EtcdConfig) Validate() error
type HttpConfig ¶
type HttpConfig struct { BasicConfig Method string Keepalive bool }
func (*HttpConfig) AddFlags ¶
func (conf *HttpConfig) AddFlags(flags *flag.FlagSet)
func (*HttpConfig) GetHttpConfig ¶
func (conf *HttpConfig) GetHttpConfig() *HttpConfig
func (*HttpConfig) Validate ¶
func (conf *HttpConfig) Validate() error
type Result ¶
type Result struct { Type string Id string Error bool Start time.Time Duration time.Duration // TODO: should we just do a map[string]interface{}? Meta map[string]string Metrics map[string]float64 }
func (*Result) Done ¶
func (r *Result) Done()
Calling Done() multiple times is OK, some Tasks will call it before they return, because they spend significant time extracting metadata.
func (*Result) MarshalJSON ¶
type ResultArchiveReader ¶
type ResultArchiveReader struct { Path string // contains filtered or unexported fields }
func NewResultArchiveReader ¶
func NewResultArchiveReader(path string) *ResultArchiveReader
func (*ResultArchiveReader) Close ¶
func (rar *ResultArchiveReader) Close() error
func (*ResultArchiveReader) Entry ¶
func (rr *ResultArchiveReader) Entry() *Result
func (*ResultArchiveReader) Reset ¶
func (rr *ResultArchiveReader) Reset()
func (*ResultArchiveReader) Scan ¶
func (rr *ResultArchiveReader) Scan() bool
type ResultArchiveWriter ¶
type ResultArchiveWriter struct { Path string // contains filtered or unexported fields }
func NewResultArchiveWriter ¶
func NewResultArchiveWriter() *ResultArchiveWriter
func (*ResultArchiveWriter) Close ¶
func (raw *ResultArchiveWriter) Close() error
func (*ResultArchiveWriter) Remove ¶
func (raw *ResultArchiveWriter) Remove() error
func (*ResultArchiveWriter) Write ¶
func (raw *ResultArchiveWriter) Write(rv *Result) error
type SwiftConfig ¶
type SwiftConfig struct { BasicConfig DatastoreConfig Username string ApiKey string AuthUrl string Region string }
func (*SwiftConfig) AddFlags ¶
func (conf *SwiftConfig) AddFlags(flags *flag.FlagSet)
func (*SwiftConfig) GetDatastoreConfig ¶
func (conf *SwiftConfig) GetDatastoreConfig() *DatastoreConfig
func (*SwiftConfig) GetSwiftConfig ¶
func (conf *SwiftConfig) GetSwiftConfig() *SwiftConfig
func (*SwiftConfig) Validate ¶
func (conf *SwiftConfig) Validate() error
type UI ¶
type UI interface { WorkStart(numTodo int64) WorkStatus(numDone int64) WorkEnd() ConfigSet(config ConfigGetter) ConfigGet() ConfigGetter }
Click to show internal directories.
Click to hide internal directories.