v0.18.0 Latest Latest

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

Go to latest
Published: Dec 14, 2018 License: Apache-2.0 Imports: 10 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Config

type Config struct {
	Proto         string             `json:"proto"`
	Protoset      string             `json:"protoset"`
	Call          string             `json:"call"`
	Cert          string             `json:"cert"`
	CName         string             `json:"cName"`
	N             int                `json:"n"`
	C             int                `json:"c"`
	QPS           int                `json:"q"`
	Z             time.Duration      `json:"z"`
	X             time.Duration      `json:"x"`
	Timeout       int                `json:"t"`
	Data          interface{}        `json:"d,omitempty"`
	DataPath      string             `json:"D"`
	BinData       []byte             `json:"-"`
	BinDataPath   string             `json:"B"`
	Metadata      *map[string]string `json:"m,omitempty"`
	MetadataPath  string             `json:"M"`
	Output        string             `json:"o"`
	Format        string             `json:"O"`
	Host          string             `json:"host"`
	DialTimeout   int                `json:"T"`
	KeepaliveTime int                `json:"L"`
	CPUs          int                `json:"cpus"`
	ImportPaths   []string           `json:"i,omitempty"`
	Insecure      bool               `json:"insecure,omitempty"`
	Name          string             `json:"name,omitempty"`

Config for the run.

func New

func New(proto, protoset, call, cert, cName string, n, c, qps int, z time.Duration, x time.Duration,
	timeout int, data, dataPath string, binData bool, binPath, metadata, mdPath, output, format, host string,
	dialTimout, keepaliveTime, cpus int, importPaths []string, insecure bool, name string) (*Config, error)

New creates a new config

func ReadConfig

func ReadConfig(path string) (*Config, error)

ReadConfig reads the JSON config from path, applies the defaults and validates

func (*Config) Default

func (c *Config) Default()

Default sets the defaults values for some of the properties that need to have valid values

func (Config) MarshalJSON

func (c Config) MarshalJSON() ([]byte, error)

MarshalJSON is our custom implementation to handle the Duration field Z

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

UnmarshalJSON is our custom implementation to handle the Duration field Z and validate data

func (*Config) Validate

func (c *Config) Validate() error

Validate the config

Jump to

Keyboard shortcuts

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