Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse added in v0.6.0

func Parse(p string, cp *CliPayload) error

Parse expects the following format: "<input name>:[<type>|]<CSV values>[;<input name>:...]". If type is not provided, then it will be string; otherwise, "int" and "float32" can be used.

func Run

func Run(args []string)

func RunWithOptions

func RunWithOptions(options *Options) error

Types

type C added in v0.6.0

type C uint8
const (
	None C = iota
	Single
	Batch
)

type CliPayload added in v0.6.0

type CliPayload struct {
	Data  map[string]interface{}
	Batch int
}

func (*CliPayload) Bind added in v0.6.0

func (c *CliPayload) Bind(k string, value interface{}, msg *client.Message) error

Bind delegates types to appropriate client.Message method.

func (*CliPayload) Iterator added in v0.6.0

func (c *CliPayload) Iterator(pair common.Pair) error

func (*CliPayload) Pair added in v0.6.0

func (c *CliPayload) Pair(key string, value interface{}) error

func (*CliPayload) SetBatch added in v0.6.0

func (c *CliPayload) SetBatch(msg *client.Message)

type Options

type Options struct {
	Host      string `short:"h" long:"host" description:"endpoint host"`
	Port      int    `short:"p" long:"port" description:"endpoint port"`
	Debug     bool   `long:"debug"`
	TimeoutUs int    `short:"t" long:"timeout"`

	Model    string `short:"m" long:"model" description:"model"`
	Storable string `short:"s" long:"storable"`

	CacheMB     int  `long:"cache"`
	NoHashCheck bool `long:"nohash"`

	Concurrent int `long:"concurrent"`

	PayloadStr   []string `short:"a" long:"payload"`
	PayloadPause int      `long:"pause" description:"pause seconds between payloads"`
	PayloadDelay int      `long:"delay" description:"pause seconds from first payload"`

	SkipError bool `long:"skiperrs"`

	NoOutput     bool `long:"noout"`
	Metrics      bool `long:"metrics"`
	ErrorHistory bool `long:"errhist"`
}

func (*Options) Hosts

func (o *Options) Hosts() []*client.Host

func (*Options) Init

func (o *Options) Init()

func (*Options) Payloads added in v0.9.0

func (o *Options) Payloads() ([]*CliPayload, error)

func (*Options) Validate

func (o *Options) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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