Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyKey = fmt.Errorf("key is empty")
ErrEmptyKey is an error that is returned when the key is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulTransport ¶
type ConsulTransport struct {
// contains filtered or unexported fields
}
ConsulTransport represents a transport mechanism for accessing and manipulating data stored in Consul Key-Value store.
func NewConsulTransport ¶
func NewConsulTransport(kv *capi.KV, opts ...ConsulTransportOpt) *ConsulTransport
NewConsulTransport creates a new ConsulTransport.
type ConsulTransportOpt ¶
type ConsulTransportOpt func(*ConsulTransport)
ConsulTransportOpt is a function type that modifies the properties of a ConsulTransport. It accepts a pointer to a ConsulTransport instance and updates its properties. TODO: add Consul enterprise options, like Namespace, Partition, etc. usefully options.
func WithUpdateInterval ¶
func WithUpdateInterval(interval time.Duration) ConsulTransportOpt
WithUpdateInterval is a ConsulTransportOpt function that sets the update interval for ConsulTransport. It ensures that the update interval is at least 100 milliseconds. It accepts a duration parameter and updates the ConsulTransport's update interval.
func WithUpdateJitter ¶ added in v1.0.1
func WithUpdateJitter(jitter time.Duration) ConsulTransportOpt
WithUpdateJitter is a ConsulTransportOpt function that sets the update jitter for ConsulTransport. It accepts a duration parameter and updates the ConsulTransport's update jitter.
type DemoTransport ¶
type DemoTransport struct {
// contains filtered or unexported fields
}
func NewDemoTransport ¶
func NewDemoTransport(payload []byte, interval time.Duration) *DemoTransport
type NatsTransport ¶
type NatsTransport struct {
// contains filtered or unexported fields
}
NatsTransport represents a transport mechanism for accessing and manipulating data stored in NATS Key-Value store.
func NewNatsTransport ¶
func NewNatsTransport(kv jetstream.KeyValue) *NatsTransport
NewNatsTransport creates a new NatsTransport.
type NothingTransport ¶
type NothingTransport struct{}
NothingTransport represents a type that doesn't actually perform any transportation. It is a struct with no fields and implements the Current and Updates methods of the transport interface. Both methods return empty results or nil.
func NewNothingTransport ¶
func NewNothingTransport() *NothingTransport
NewNothingTransport creates a new NothingTransport.