route

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: BSD-2-Clause-Views Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Instance string
View Source
var UserAgent string

Functions

This section is empty.

Types

type CloudWatch

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

Publishes data points to the native AWS metrics service: CloudWatch

func (*CloudWatch) Add

func (route *CloudWatch) Add(dest *dest.Destination)

func (*CloudWatch) DelDestination

func (route *CloudWatch) DelDestination(index int) error

func (*CloudWatch) Dispatch

func (r *CloudWatch) Dispatch(buf []byte)

Dispatch is called to submit metrics. They will be in graphite 'plain' format no matter how they arrived.

func (*CloudWatch) Flush

func (r *CloudWatch) Flush() error

Flush is not currently implemented

func (*CloudWatch) GetDestination

func (route *CloudWatch) GetDestination(index int) (*dest.Destination, error)

func (*CloudWatch) Key

func (route *CloudWatch) Key() string

func (*CloudWatch) Match

func (route *CloudWatch) Match(s []byte) bool

func (*CloudWatch) Shutdown

func (r *CloudWatch) Shutdown() error

Shutdown stops the CloudWatch publisher and returns with the publisher has finished in-flight work

func (*CloudWatch) Snapshot

func (route *CloudWatch) Snapshot() Snapshot

to view the state of the table/route at any point in time

func (*CloudWatch) Update

func (route *CloudWatch) Update(opts map[string]string) error

func (*CloudWatch) UpdateDestination

func (route *CloudWatch) UpdateDestination(index int, opts map[string]string) error

func (*CloudWatch) UpdateMatcher

func (route *CloudWatch) UpdateMatcher(matcher matcher.Matcher)

type Config

type Config interface {
	Matcher() *matcher.Matcher
	Dests() []*dest.Destination
}

type ConsistentHasher

type ConsistentHasher struct {
	Ring hashRing
	// contains filtered or unexported fields
}

func NewConsistentHasher

func NewConsistentHasher(destinations []*dest.Destination, withFix bool) ConsistentHasher

func NewConsistentHasherReplicaCount

func NewConsistentHasherReplicaCount(destinations []*dest.Destination, replicaCount int, withFix bool) ConsistentHasher

func (*ConsistentHasher) AddDestination

func (h *ConsistentHasher) AddDestination(d *dest.Destination)

func (*ConsistentHasher) GetDestinationIndex

func (h *ConsistentHasher) GetDestinationIndex(key []byte) int

GetDestinationIndex returns the index of the destination corresponding to the provided key.

type ConsistentHashing

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

func (*ConsistentHashing) Add

func (route *ConsistentHashing) Add(dest *dest.Destination)

func (*ConsistentHashing) DelDestination

func (route *ConsistentHashing) DelDestination(index int) error

func (*ConsistentHashing) Dispatch

func (route *ConsistentHashing) Dispatch(buf []byte)

func (*ConsistentHashing) Flush

func (route *ConsistentHashing) Flush() error

func (*ConsistentHashing) GetDestination

func (route *ConsistentHashing) GetDestination(index int) (*dest.Destination, error)

func (*ConsistentHashing) Key

func (route *ConsistentHashing) Key() string

func (*ConsistentHashing) Match

func (route *ConsistentHashing) Match(s []byte) bool

func (*ConsistentHashing) Shutdown

func (route *ConsistentHashing) Shutdown() error

func (*ConsistentHashing) Snapshot

func (route *ConsistentHashing) Snapshot() Snapshot

to view the state of the table/route at any point in time

func (*ConsistentHashing) Update

func (route *ConsistentHashing) Update(opts map[string]string) error

func (*ConsistentHashing) UpdateDestination

func (route *ConsistentHashing) UpdateDestination(index int, opts map[string]string) error

func (*ConsistentHashing) UpdateMatcher

func (route *ConsistentHashing) UpdateMatcher(matcher matcher.Matcher)

type GrafanaNet

type GrafanaNet struct {
	Cfg GrafanaNetConfig
	// contains filtered or unexported fields
}

func (*GrafanaNet) Add

func (route *GrafanaNet) Add(dest *dest.Destination)

func (*GrafanaNet) DelDestination

func (route *GrafanaNet) DelDestination(index int) error

func (*GrafanaNet) Dispatch

func (route *GrafanaNet) Dispatch(buf []byte)

Dispatch takes in the requested buf or drops it if blocking mode and queue of the shard is full

func (*GrafanaNet) Flush

func (route *GrafanaNet) Flush() error

func (*GrafanaNet) GetDestination

func (route *GrafanaNet) GetDestination(index int) (*dest.Destination, error)

func (*GrafanaNet) Key

func (route *GrafanaNet) Key() string

func (*GrafanaNet) Match

func (route *GrafanaNet) Match(s []byte) bool

func (*GrafanaNet) Shutdown

func (route *GrafanaNet) Shutdown() error

func (*GrafanaNet) Snapshot

func (route *GrafanaNet) Snapshot() Snapshot

func (*GrafanaNet) Update

func (route *GrafanaNet) Update(opts map[string]string) error

func (*GrafanaNet) UpdateDestination

func (route *GrafanaNet) UpdateDestination(index int, opts map[string]string) error

func (*GrafanaNet) UpdateMatcher

func (route *GrafanaNet) UpdateMatcher(matcher matcher.Matcher)

type GrafanaNetConfig added in v1.2.1

type GrafanaNetConfig struct {
	// mandatory
	Addr        string
	ApiKey      string
	SchemasFile string

	// optional
	AggregationFile string
	BufSize         int           // amount of messages we can buffer up.
	FlushMaxNum     int           // flush after this many metrics seen
	FlushMaxWait    time.Duration // flush after this much time passed
	Timeout         time.Duration // timeout for http operations
	Concurrency     int           // number of concurrent connections to tsdb-gw
	OrgID           int
	SSLVerify       bool
	Blocking        bool
	Spool           bool // ignored for now

	// optional http backoff params for posting metrics and schemas
	ErrBackoffMin    time.Duration
	ErrBackoffFactor float64
}

func NewGrafanaNetConfig added in v1.2.1

func NewGrafanaNetConfig(addr, apiKey, schemasFile, aggregationFile string) (GrafanaNetConfig, error)

type KafkaMdm

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

func (*KafkaMdm) Add

func (route *KafkaMdm) Add(dest *dest.Destination)

func (*KafkaMdm) DelDestination

func (route *KafkaMdm) DelDestination(index int) error

func (*KafkaMdm) Dispatch

func (r *KafkaMdm) Dispatch(buf []byte)

func (*KafkaMdm) Flush

func (r *KafkaMdm) Flush() error

func (*KafkaMdm) GetDestination

func (route *KafkaMdm) GetDestination(index int) (*dest.Destination, error)

func (*KafkaMdm) Key

func (route *KafkaMdm) Key() string

func (*KafkaMdm) Match

func (route *KafkaMdm) Match(s []byte) bool

func (*KafkaMdm) Shutdown

func (r *KafkaMdm) Shutdown() error

func (*KafkaMdm) Snapshot

func (route *KafkaMdm) Snapshot() Snapshot

to view the state of the table/route at any point in time

func (*KafkaMdm) Update

func (route *KafkaMdm) Update(opts map[string]string) error

func (*KafkaMdm) UpdateDestination

func (route *KafkaMdm) UpdateDestination(index int, opts map[string]string) error

func (*KafkaMdm) UpdateMatcher

func (route *KafkaMdm) UpdateMatcher(matcher matcher.Matcher)

type MetricsResponse

type MetricsResponse struct {
	Invalid          int
	Published        int
	ValidationErrors map[string]ValidationError
}

type PubSub

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

PubSub publishes metrics to a Google PubSub topic

func (*PubSub) Add

func (route *PubSub) Add(dest *dest.Destination)

func (*PubSub) DelDestination

func (route *PubSub) DelDestination(index int) error

func (*PubSub) Dispatch

func (r *PubSub) Dispatch(buf []byte)

Dispatch is called to submit metrics. They will be in graphite 'plain' format no matter how they arrived.

func (*PubSub) Flush

func (r *PubSub) Flush() error

Flush is not currently implemented

func (*PubSub) GetDestination

func (route *PubSub) GetDestination(index int) (*dest.Destination, error)

func (*PubSub) Key

func (route *PubSub) Key() string

func (*PubSub) Match

func (route *PubSub) Match(s []byte) bool

func (*PubSub) Shutdown

func (r *PubSub) Shutdown() error

Shutdown stops the pubsub publisher and returns with the publisher has finished in-flight work

func (*PubSub) Snapshot

func (route *PubSub) Snapshot() Snapshot

to view the state of the table/route at any point in time

func (*PubSub) Update

func (route *PubSub) Update(opts map[string]string) error

func (*PubSub) UpdateDestination

func (route *PubSub) UpdateDestination(index int, opts map[string]string) error

func (*PubSub) UpdateMatcher

func (route *PubSub) UpdateMatcher(matcher matcher.Matcher)

type Route

type Route interface {
	Dispatch(buf []byte)
	Match(s []byte) bool
	Snapshot() Snapshot
	Key() string
	Flush() error
	Shutdown() error
	GetDestination(index int) (*dest.Destination, error)
	DelDestination(index int) error
	UpdateDestination(index int, opts map[string]string) error
	Update(opts map[string]string) error
}

func NewCloudWatch

func NewCloudWatch(key string, matcher matcher.Matcher, awsProfile, awsRegion, awsNamespace string, awsDimensions [][]string, bufSize, flushMaxSize, flushMaxWait int, storageResolution int64, blocking bool) (Route, error)

NewCloudWatch creates a route that writes metrics to the AWS service CloudWatch We will automatically run the route and the destination

func NewConsistentHashing

func NewConsistentHashing(key string, matcher matcher.Matcher, destinations []*dest.Destination, withFix bool) (Route, error)

func NewGrafanaNet

func NewGrafanaNet(key string, matcher matcher.Matcher, cfg GrafanaNetConfig) (Route, error)

NewGrafanaNet creates a special route that writes to a grafana.net datastore We will automatically run the route and the destination

func NewKafkaMdm

func NewKafkaMdm(key string, matcher matcher.Matcher, topic, codec, schemasFile, partitionBy string, brokers []string, bufSize, orgId, flushMaxNum, flushMaxWait, timeout int, blocking bool, tlsEnabled, tlsSkipVerify bool, tlsClientCert, tlsClientKey string, saslEnabled bool, saslMechanism string, saslUsername, saslPassword string) (Route, error)

NewKafkaMdm creates a special route that writes to a grafana.net datastore We will automatically run the route and the destination

func NewPubSub

func NewPubSub(key string, matcher matcher.Matcher, project, topic, format, codec string, bufSize, flushMaxSize, flushMaxWait int, blocking bool) (Route, error)

NewPubSub creates a route that writes metrics to a Google PubSub topic We will automatically run the route and the destination

func NewSendAllMatch

func NewSendAllMatch(key string, matcher matcher.Matcher, destinations []*dest.Destination) (Route, error)

NewSendAllMatch creates a sendAllMatch route. We will automatically run the route and the given destinations

func NewSendFirstMatch

func NewSendFirstMatch(key string, matcher matcher.Matcher, destinations []*dest.Destination) (Route, error)

NewSendFirstMatch creates a sendFirstMatch route. We will automatically run the route and the given destinations

type SendAllMatch

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

func (*SendAllMatch) Add

func (route *SendAllMatch) Add(dest *dest.Destination)

func (*SendAllMatch) DelDestination

func (route *SendAllMatch) DelDestination(index int) error

func (*SendAllMatch) Dispatch

func (route *SendAllMatch) Dispatch(buf []byte)

func (*SendAllMatch) Flush

func (route *SendAllMatch) Flush() error

func (*SendAllMatch) GetDestination

func (route *SendAllMatch) GetDestination(index int) (*dest.Destination, error)

func (*SendAllMatch) Key

func (route *SendAllMatch) Key() string

func (*SendAllMatch) Match

func (route *SendAllMatch) Match(s []byte) bool

func (*SendAllMatch) Shutdown

func (route *SendAllMatch) Shutdown() error

func (*SendAllMatch) Snapshot

func (route *SendAllMatch) Snapshot() Snapshot

to view the state of the table/route at any point in time

func (*SendAllMatch) Update

func (route *SendAllMatch) Update(opts map[string]string) error

func (*SendAllMatch) UpdateDestination

func (route *SendAllMatch) UpdateDestination(index int, opts map[string]string) error

func (*SendAllMatch) UpdateMatcher

func (route *SendAllMatch) UpdateMatcher(matcher matcher.Matcher)

type SendFirstMatch

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

func (*SendFirstMatch) Add

func (route *SendFirstMatch) Add(dest *dest.Destination)

func (*SendFirstMatch) DelDestination

func (route *SendFirstMatch) DelDestination(index int) error

func (*SendFirstMatch) Dispatch

func (route *SendFirstMatch) Dispatch(buf []byte)

func (*SendFirstMatch) Flush

func (route *SendFirstMatch) Flush() error

func (*SendFirstMatch) GetDestination

func (route *SendFirstMatch) GetDestination(index int) (*dest.Destination, error)

func (*SendFirstMatch) Key

func (route *SendFirstMatch) Key() string

func (*SendFirstMatch) Match

func (route *SendFirstMatch) Match(s []byte) bool

func (*SendFirstMatch) Shutdown

func (route *SendFirstMatch) Shutdown() error

func (*SendFirstMatch) Snapshot

func (route *SendFirstMatch) Snapshot() Snapshot

to view the state of the table/route at any point in time

func (*SendFirstMatch) Update

func (route *SendFirstMatch) Update(opts map[string]string) error

func (*SendFirstMatch) UpdateDestination

func (route *SendFirstMatch) UpdateDestination(index int, opts map[string]string) error

func (*SendFirstMatch) UpdateMatcher

func (route *SendFirstMatch) UpdateMatcher(matcher matcher.Matcher)

type Snapshot

type Snapshot struct {
	Matcher matcher.Matcher     `json:"matcher"`
	Dests   []*dest.Destination `json:"destination"`
	Type    string              `json:"type"`
	Key     string              `json:"key"`
	Addr    string              `json:"addr,omitempty"`
}

type ValidationError

type ValidationError struct {
	Count      int
	ExampleIds []int
}

type XDGSCRAMClient added in v0.14.0

type XDGSCRAMClient struct {
	*scram.Client
	*scram.ClientConversation
	scram.HashGeneratorFcn
}

func (*XDGSCRAMClient) Begin added in v0.14.0

func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)

func (*XDGSCRAMClient) Done added in v0.14.0

func (x *XDGSCRAMClient) Done() bool

func (*XDGSCRAMClient) Step added in v0.14.0

func (x *XDGSCRAMClient) Step(challenge string) (response string, err error)

Jump to

Keyboard shortcuts

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