Documentation
¶
Index ¶
- type Collector
- func (c *Collector) AddInput(name string, cfg map[string]interface{}) error
- func (c *Collector) AddOutput(name string, cfg map[string]interface{}) error
- func (c *Collector) AddSubscriptionConfig(sc *types.SubscriptionConfig) error
- func (c *Collector) AddTarget(tc *types.TargetConfig) error
- func (c *Collector) Capabilities(ctx context.Context, tName string, ext ...*gnmi_ext.Extension) (*gnmi.CapabilityResponse, error)
- func (c *Collector) CreateTarget(name string) error
- func (c *Collector) DeleteOutput(name string) error
- func (c *Collector) DeleteSubscription(name string) error
- func (c *Collector) DeleteTarget(ctx context.Context, name string) error
- func (c *Collector) Export(ctx context.Context, rsp *gnmi.SubscribeResponse, m outputs.Meta, ...)
- func (c *Collector) Get(ctx context.Context, tName string, req *gnmi.GetRequest) (*gnmi.GetResponse, error)
- func (c *Collector) GetModels(ctx context.Context, tName string) ([]*gnmi.ModelData, error)
- func (c *Collector) InitInputs(ctx context.Context)
- func (c *Collector) InitOutput(ctx context.Context, name string, tcs map[string]*types.TargetConfig)
- func (c *Collector) InitOutputs(ctx context.Context)
- func (c *Collector) PolledSubscriptionsTargets() map[string][]string
- func (c *Collector) Set(ctx context.Context, tName string, req *gnmi.SetRequest) (*gnmi.SetResponse, error)
- func (c *Collector) Start(ctx context.Context)
- func (c *Collector) StopTarget(ctx context.Context, name string) error
- func (c *Collector) Subscribe(ctx context.Context, tName string) error
- func (c *Collector) SubscribeOnce(ctx context.Context, tName string) error
- func (c *Collector) TargetPoll(targetName, subscriptionName string) (*gnmi.SubscribeResponse, error)
- func (c *Collector) TargetSubscribeOnce(ctx context.Context, name string) error
- func (c *Collector) TargetSubscribePoll(ctx context.Context, name string)
- func (c *Collector) TargetSubscribeStream(ctx context.Context, name string)
- type CollectorOption
- func WithCache(ch *cache.Cache) CollectorOption
- func WithDialOptions(dialOptions []grpc.DialOption) CollectorOption
- func WithEventProcessors(eps map[string]map[string]interface{}) CollectorOption
- func WithInputs(inputsConfig map[string]map[string]interface{}) CollectorOption
- func WithLocker(locker lockers.Locker) CollectorOption
- func WithLogger(logger *log.Logger) CollectorOption
- func WithOutputs(outs map[string]map[string]interface{}) CollectorOption
- func WithPrometheusRegistry(reg *prometheus.Registry) CollectorOption
- func WithProtoDescriptor(d desc.Descriptor) CollectorOption
- func WithSubscriptions(subs map[string]*types.SubscriptionConfig) CollectorOption
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct { Config *Config Subscriptions map[string]*types.SubscriptionConfig Outputs map[string]outputs.Output Inputs map[string]inputs.Input Targets map[string]*target.Target EventProcessorsConfig map[string]map[string]interface{} // contains filtered or unexported fields }
Collector //
func New ¶ added in v0.18.0
func New(config *Config, targetConfigs map[string]*types.TargetConfig, opts ...CollectorOption) *Collector
New //
func (*Collector) AddInput ¶ added in v0.7.0
AddInput adds an input called name, with config cfg to the collector instance
func (*Collector) AddOutput ¶ added in v0.5.1
AddOutput initializes an output called name, with config cfg if it does not already exist
func (*Collector) AddSubscriptionConfig ¶ added in v0.5.1
func (c *Collector) AddSubscriptionConfig(sc *types.SubscriptionConfig) error
AddSubscriptionConfig adds a subscriptionConfig sc to Collector's map if it does not already exists
func (*Collector) AddTarget ¶ added in v0.5.1
func (c *Collector) AddTarget(tc *types.TargetConfig) error
AddTarget initializes a target based on *TargetConfig
func (*Collector) Capabilities ¶ added in v0.5.0
func (*Collector) CreateTarget ¶ added in v0.14.0
func (*Collector) DeleteOutput ¶ added in v0.5.1
func (*Collector) DeleteSubscription ¶ added in v0.5.1
func (*Collector) DeleteTarget ¶ added in v0.5.1
func (*Collector) Get ¶ added in v0.5.0
func (c *Collector) Get(ctx context.Context, tName string, req *gnmi.GetRequest) (*gnmi.GetResponse, error)
func (*Collector) InitInputs ¶ added in v0.7.0
func (*Collector) InitOutput ¶ added in v0.5.1
func (*Collector) InitOutputs ¶ added in v0.5.1
func (*Collector) PolledSubscriptionsTargets ¶
PolledSubscriptionsTargets returns a map of target name to a list of subscription names that have Mode == POLL
func (*Collector) Set ¶ added in v0.5.0
func (c *Collector) Set(ctx context.Context, tName string, req *gnmi.SetRequest) (*gnmi.SetResponse, error)
func (*Collector) Start ¶
Start start the prometheus server as well as a goroutine per target selecting on the response chan, the error chan and the ctx.Done() chan
func (*Collector) StopTarget ¶ added in v0.7.0
func (*Collector) SubscribeOnce ¶ added in v0.8.0
func (*Collector) TargetPoll ¶
func (c *Collector) TargetPoll(targetName, subscriptionName string) (*gnmi.SubscribeResponse, error)
TargetPoll sends a gnmi.SubscribeRequest_Poll to targetName and returns the response and an error, it uses the targetName and the subscriptionName strings to find the gnmi.GNMI_SubscribeClient
func (*Collector) TargetSubscribeOnce ¶ added in v0.8.0
func (*Collector) TargetSubscribePoll ¶ added in v0.8.0
type CollectorOption ¶ added in v0.4.0
type CollectorOption func(c *Collector)
func WithCache ¶ added in v0.18.0
func WithCache(ch *cache.Cache) CollectorOption
func WithDialOptions ¶ added in v0.4.0
func WithDialOptions(dialOptions []grpc.DialOption) CollectorOption
func WithEventProcessors ¶ added in v0.6.0
func WithEventProcessors(eps map[string]map[string]interface{}) CollectorOption
func WithInputs ¶ added in v0.7.0
func WithInputs(inputsConfig map[string]map[string]interface{}) CollectorOption
func WithLocker ¶ added in v0.7.0
func WithLocker(locker lockers.Locker) CollectorOption
func WithLogger ¶ added in v0.4.0
func WithLogger(logger *log.Logger) CollectorOption
func WithOutputs ¶ added in v0.4.0
func WithOutputs(outs map[string]map[string]interface{}) CollectorOption
func WithPrometheusRegistry ¶ added in v0.18.0
func WithPrometheusRegistry(reg *prometheus.Registry) CollectorOption
func WithProtoDescriptor ¶ added in v0.9.0
func WithProtoDescriptor(d desc.Descriptor) CollectorOption
func WithSubscriptions ¶ added in v0.4.0
func WithSubscriptions(subs map[string]*types.SubscriptionConfig) CollectorOption