Documentation ¶
Index ¶
- Constants
- func ParseServiceName(path string) string
- func ParseStreamName(path string) string
- func ParseStreamTranscoder(path string) string
- func PathIsStream(path string) bool
- func PathIsStreamSettings(path string) bool
- func PathIsStreamTranscoder(path string) bool
- func ServicePath(serviceName string, clientName string) string
- func ServicePrefix(prefix string) string
- func StreamPath(name string) string
- func StreamSettingsPath(name string) string
- func StreamTranscoderPath(name string) string
- type Client
- func (client *Client) Errors() <-chan error
- func (client *Client) Get(ctx context.Context, key string) ([]byte, error)
- func (client *Client) GetWithPrefix(ctx context.Context, prefix string) ([]Field, error)
- func (client *Client) PublishService(ctx context.Context, service string, data string) error
- func (client *Client) PublishWithLease(ctx context.Context, key string, value string, ttl time.Duration) (LeaseID, error)
- func (client *Client) Put(ctx context.Context, key string, value []byte) error
- func (client *Client) RefreshLease(ctx context.Context, id LeaseID) error
- func (client *Client) RevokeLease(ctx context.Context, id LeaseID) error
- func (client *Client) Wait()
- func (client *Client) Watch(ctx context.Context, prefix string) (UpdateChan, error)
- type ConsulClient
- func (cc *ConsulClient) Close()
- func (cc *ConsulClient) Delete(ctx context.Context, key string) error
- func (cc *ConsulClient) Errors() <-chan error
- func (cc *ConsulClient) Put(ctx context.Context, key string, value []byte) error
- func (cc *ConsulClient) PutWithSession(ctx context.Context, key string, value []byte) error
- func (cc *ConsulClient) Watch(ctx context.Context, prefix string) (UpdateChan, error)
- type ConsulKV
- type ErrAlreadyAquired
- type EtcdKV
- type Field
- type KVAPI
- type KeepaliveAPI
- type KeyValue
- type LeaseID
- type ServiceAPI
- type UpdateChan
- type UpdateType
- type WatchAPI
- type WatchUpdate
Constants ¶
View Source
const ( TranscoderPrefix = "service/transcode/" SourcePrefix = "service/source/" FanoutPrefix = "service/fanout/" StreamPrefix = "stream/" StreamSettingsPrefix = "streamSettings/" )
prefixes
Variables ¶
This section is empty.
Functions ¶
func ParseServiceName ¶
ParseServiceName parses service name from path, returns "" if path is not a service path
func ParseStreamName ¶
func ParseStreamTranscoder ¶
func PathIsStream ¶
func PathIsStreamSettings ¶
func PathIsStreamTranscoder ¶
func ServicePath ¶
func ServicePrefix ¶
func StreamPath ¶
func StreamSettingsPath ¶
func StreamTranscoderPath ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper for a etcdv3 client
func (*Client) GetWithPrefix ¶
func (*Client) PublishService ¶
publishService publishes a service endpoint on the current host
func (*Client) PublishWithLease ¶
func (client *Client) PublishWithLease(ctx context.Context, key string, value string, ttl time.Duration) (LeaseID, error)
publishWithLease publishes a key with a new lease if the key doesn't exist yet
func (*Client) RefreshLease ¶
func (*Client) RevokeLease ¶
type ConsulClient ¶
type ConsulClient struct {
// contains filtered or unexported fields
}
func NewConsulClient ¶
func (*ConsulClient) Close ¶
func (cc *ConsulClient) Close()
func (*ConsulClient) Delete ¶
func (cc *ConsulClient) Delete(ctx context.Context, key string) error
kv delete with expiring session
func (*ConsulClient) Errors ¶
func (cc *ConsulClient) Errors() <-chan error
func (*ConsulClient) PutWithSession ¶
func (*ConsulClient) Watch ¶
func (cc *ConsulClient) Watch(ctx context.Context, prefix string) (UpdateChan, error)
Watch watches the consul key for changes
type ErrAlreadyAquired ¶
type ErrAlreadyAquired struct {
Key string
}
kv put with expiring session
func (*ErrAlreadyAquired) Error ¶
func (e *ErrAlreadyAquired) Error() string
type KVAPI ¶
type KVAPI interface { // Get(ctx context.Context, key string) ([]byte, error) // GetWithPrefix(ctx context.Context, prefix string) ([]Field, error) Put(ctx context.Context, key string, value []byte) error PutWithSession(ctx context.Context, key string, value []byte) error Delete(ctx context.Context, key string) error }
type KeepaliveAPI ¶
type ServiceAPI ¶
type UpdateChan ¶
type UpdateChan chan []*WatchUpdate
type WatchAPI ¶
type WatchAPI interface { // Watch Prefix Watch(ctx context.Context, prefix string) (UpdateChan, error) }
type WatchUpdate ¶
type WatchUpdate struct { Type UpdateType KV KeyValue }
Click to show internal directories.
Click to hide internal directories.