client

package
v0.16.1-beta Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2016 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigMapToConfig

func ConfigMapToConfig(cfg *rpc.ConfigMap) *cdata.ConfigDataNode

func ConfigToConfigMap

func ConfigToConfigMap(cd *cdata.ConfigDataNode) *rpc.ConfigMap

func NewMetrics

func NewMetrics(ms []core.Metric) []*rpc.Metric

func ParseConfig

func ParseConfig(config *rpc.ConfigMap) map[string]ctypes.ConfigValue

func ToConfigMap

func ToConfigMap(cv map[string]ctypes.ConfigValue) *rpc.ConfigMap

func ToCoreMetric

func ToCoreMetric(mt *rpc.Metric) core.Metric

func ToCoreMetrics

func ToCoreMetrics(mts []*rpc.Metric) []core.Metric

func ToCoreNamespace

func ToCoreNamespace(n []*rpc.NamespaceElement) core.Namespace

func ToMetric

func ToMetric(co core.Metric) *rpc.Metric

func ToNamespace

func ToNamespace(n core.Namespace) []*rpc.NamespaceElement

func ToTime

func ToTime(t time.Time) *rpc.Time

Types

type CallsRPC

type CallsRPC interface {
	Call(methd string, args interface{}, reply interface{}) error
}

CallsRPC provides an interface for RPC clients

type PluginClient

type PluginClient interface {
	SetKey() error
	Ping() error
	Kill(string) error
	GetConfigPolicy() (*cpolicy.ConfigPolicy, error)
}

PluginClient A client providing common plugin method calls.

type PluginCollectorClient

type PluginCollectorClient interface {
	PluginClient
	CollectMetrics([]core.Metric) ([]core.Metric, error)
	GetMetricTypes(plugin.ConfigType) ([]core.Metric, error)
}

PluginCollectorClient A client providing collector specific plugin method calls.

func NewCollectorGrpcClient

func NewCollectorGrpcClient(address string, timeout time.Duration, pub *rsa.PublicKey, secure bool) (PluginCollectorClient, error)

NewCollectorGrpcClient returns a collector gRPC Client.

func NewCollectorHttpJSONRPCClient

func NewCollectorHttpJSONRPCClient(u string, timeout time.Duration, pub *rsa.PublicKey, secure bool) (PluginCollectorClient, error)

NewCollectorHttpJSONRPCClient returns CollectorHttpJSONRPCClient

func NewCollectorNativeClient

func NewCollectorNativeClient(address string, timeout time.Duration, pub *rsa.PublicKey, secure bool) (PluginCollectorClient, error)

type PluginNativeClient

type PluginNativeClient struct {
	// contains filtered or unexported fields
}

Native clients use golang net/rpc for communication to a native rpc server.

func (*PluginNativeClient) CollectMetrics

func (p *PluginNativeClient) CollectMetrics(mts []core.Metric) ([]core.Metric, error)

func (*PluginNativeClient) GetConfigPolicy

func (p *PluginNativeClient) GetConfigPolicy() (*cpolicy.ConfigPolicy, error)

func (*PluginNativeClient) GetMetricTypes

func (p *PluginNativeClient) GetMetricTypes(config plugin.ConfigType) ([]core.Metric, error)

func (*PluginNativeClient) GetType

func (p *PluginNativeClient) GetType() string

GetType returns the string type of the plugin Note: the first letter of the type will be capitalized.

func (*PluginNativeClient) Kill

func (p *PluginNativeClient) Kill(reason string) error

func (*PluginNativeClient) Ping

func (p *PluginNativeClient) Ping() error

func (*PluginNativeClient) Process

func (p *PluginNativeClient) Process(metrics []core.Metric, config map[string]ctypes.ConfigValue) ([]core.Metric, error)

func (*PluginNativeClient) Publish

func (p *PluginNativeClient) Publish(metrics []core.Metric, config map[string]ctypes.ConfigValue) error

func (*PluginNativeClient) SetKey

func (p *PluginNativeClient) SetKey() error

type PluginProcessorClient

type PluginProcessorClient interface {
	PluginClient
	Process([]core.Metric, map[string]ctypes.ConfigValue) ([]core.Metric, error)
}

PluginProcessorClient A client providing processor specific plugin method calls.

func NewProcessorGrpcClient

func NewProcessorGrpcClient(address string, timeout time.Duration, pub *rsa.PublicKey, secure bool) (PluginProcessorClient, error)

NewProcessorGrpcClient returns a processor gRPC Client.

func NewProcessorHttpJSONRPCClient

func NewProcessorHttpJSONRPCClient(u string, timeout time.Duration, pub *rsa.PublicKey, secure bool) (PluginProcessorClient, error)

func NewProcessorNativeClient

func NewProcessorNativeClient(address string, timeout time.Duration, pub *rsa.PublicKey, secure bool) (PluginProcessorClient, error)

type PluginPublisherClient

type PluginPublisherClient interface {
	PluginClient
	Publish([]core.Metric, map[string]ctypes.ConfigValue) error
}

PluginPublisherClient A client providing publishing specific plugin method calls.

func NewPublisherGrpcClient

func NewPublisherGrpcClient(address string, timeout time.Duration, pub *rsa.PublicKey, secure bool) (PluginPublisherClient, error)

NewPublisherGrpcClient returns a publisher gRPC Client.

func NewPublisherHttpJSONRPCClient

func NewPublisherHttpJSONRPCClient(u string, timeout time.Duration, pub *rsa.PublicKey, secure bool) (PluginPublisherClient, error)

func NewPublisherNativeClient

func NewPublisherNativeClient(address string, timeout time.Duration, pub *rsa.PublicKey, secure bool) (PluginPublisherClient, error)

Jump to

Keyboard shortcuts

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