Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) GetInterfaceConfig(ctx context.Context, ifaces ...string) (ifaceConfigs config.Ifaces, err error)
- func (c *Client) GetInterfaceStatus(ctx context.Context, ifaces ...string) (statuses map[string]capturetypes.CaptureStats, lastWriteout time.Time, ...)
- func (c *Client) Query(ctx context.Context, args *query.Args) (*results.Result, error)
- func (c *Client) ReloadConfig(ctx context.Context) (enabled, updated, disabled capturetypes.IfaceChanges, err error)
- func (c *Client) Run(ctx context.Context, args *query.Args) (*results.Result, error)
- func (c *Client) UpdateInterfaceConfigs(ctx context.Context, ifaceConfigs config.Ifaces) (enabled, updated, disabled capturetypes.IfaceChanges, err error)
- func (c *Client) Validate(ctx context.Context, args *query.Args) (*results.Result, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
var (
ErrorEmptyAddress = errors.New("no endpoint address (host:port) provided") // ErrorEmptyAddress : Denotes that an empty config has been provided
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*client.DefaultClient
}
Client provides a client that calls goProbe's API functions
func NewFromConfig ¶
NewFromConfig creates the client based on cfg
func NewFromConfigFile ¶
NewFromConfigFile creates the client based on configuration from a file
func NewFromReader ¶
NewFromReader creates the client based on configuration read from an io.Reader
func (*Client) GetInterfaceConfig ¶
func (c *Client) GetInterfaceConfig(ctx context.Context, ifaces ...string) (ifaceConfigs config.Ifaces, err error)
GetInterfaceConfig returns goprobe's runtime configuration for the queried interfaces. If ifaces is empty or omitted, the runtime configuration for all interfaces is returned
func (*Client) GetInterfaceStatus ¶
func (c *Client) GetInterfaceStatus(ctx context.Context, ifaces ...string) (statuses map[string]capturetypes.CaptureStats, lastWriteout time.Time, startedAt time.Time, err error)
GetInterfaceStatus returns the interface capture stats from the running goProbe instance
func (*Client) ReloadConfig ¶
func (c *Client) ReloadConfig(ctx context.Context) (enabled, updated, disabled capturetypes.IfaceChanges, err error)
ReloadConfig reads / updates goprobe's runtime configuration with the one from disk
func (*Client) UpdateInterfaceConfigs ¶
func (c *Client) UpdateInterfaceConfigs(ctx context.Context, ifaceConfigs config.Ifaces) (enabled, updated, disabled capturetypes.IfaceChanges, err error)
UpdateInterfaceConfigs updates goprobe's runtime configuration for the provided interfaces
type Config ¶
type Config struct {
Scheme string `json:"scheme" yaml:"scheme"`
Addr string `json:"addr" yaml:"addr"`
Key string `json:"key,omitempty" yaml:"key,omitempty"`
RequestTimeout time.Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"`
Log bool `json:"log" yaml:"log"`
}
Config specifies the configurable parts of the client