Documentation ¶
Index ¶
- Constants
- Variables
- type BlobEtcdKey
- type BlobsCollection
- type ClusterEtcdKey
- type EtcdCollection
- func NewBlobsCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)
- func NewNodesCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)
- func NewQueuesCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)
- func NewRefsCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)
- func NewTopicsCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)
- type EtcdKey
- type EtcdValue
- type GetOption
- type ListOption
- type NodesCollection
- type QueueEtcdKey
- type QueuesCollection
- type RefsCollection
- type RefsEtcdKey
- type TopicEtcdKey
- type TopicsCollection
- type Transaction
Constants ¶
View Source
const ( BlobsObserverContextVar = "app.observer.blobs" BlobsEtcd = "/blobs" )
View Source
const ( ClusterObserverContextVar = "app.observer.cluster" ClusterEtcd = "/cluster" )
View Source
const ( PrefixKey GetOption = iota FirstKey LastKey CountKey SortAscend ListOption = iota SortDescend NoPartition = -1 NoOffset = -1 NoOrder = -1 NoString = "" )
View Source
const ( QueuesObserverContextVar = "app.observer.queues" QueuesEtcd = "/queues" )
View Source
const ( RefsObserverContextVar = "app.observer.refs" RefsEtcd = "/refs" )
View Source
const ( TopicsObserverContextVar = "app.observer.topics" TopicsEtcd = "/topics" )
Variables ¶
View Source
var ( ErrKeyExists = errors.New("key already exists") ErrKeyNotFound = errors.New("key not found") )
Functions ¶
This section is empty.
Types ¶
type BlobEtcdKey ¶
type BlobEtcdKey struct { Digest digest.Digest `json:"digest"` Group string `json:"group"` Host string `json:"host"` }
func ParseBlobsEtcdKey ¶
func ParseBlobsEtcdKey(value string) (*BlobEtcdKey, error)
func (*BlobEtcdKey) String ¶
func (k *BlobEtcdKey) String() (res string)
type BlobsCollection ¶
type BlobsCollection struct {
EtcdCollection
}
type ClusterEtcdKey ¶
func ParseClusterEtcdKey ¶
func ParseClusterEtcdKey(value string) (*ClusterEtcdKey, error)
func (*ClusterEtcdKey) String ¶
func (k *ClusterEtcdKey) String() (res string)
type EtcdCollection ¶
type EtcdCollection interface { Context() context.Context Client() *etcd.EtcdClient List(prefixKey EtcdKey, opts ...ListOption) ([]EtcdValue, error) ListRange(firstKey EtcdKey, lastKey EtcdKey) ([]EtcdValue, error) Get(key EtcdKey, opts ...GetOption) (*EtcdValue, error) Create(key EtcdKey, value string) (EtcdKey, error) Put(key EtcdKey, value string) error Delete(key EtcdKey) error }
func NewBlobsCollection ¶
func NewNodesCollection ¶
func NewQueuesCollection ¶
func NewRefsCollection ¶
func NewTopicsCollection ¶
type ListOption ¶
type ListOption int
type NodesCollection ¶
type NodesCollection struct {
EtcdCollection
}
type QueueEtcdKey ¶
type QueueEtcdKey struct { Topic string `json:"topic"` Partition int64 `json:"partition"` Offset int64 `json:"offset"` }
func ParseQueueEtcdKey ¶
func ParseQueueEtcdKey(value string) (*QueueEtcdKey, error)
func (*QueueEtcdKey) String ¶
func (k *QueueEtcdKey) String() (res string)
type QueuesCollection ¶
type QueuesCollection struct {
EtcdCollection
}
type RefsCollection ¶
type RefsCollection struct {
EtcdCollection
}
type RefsEtcdKey ¶
type RefsEtcdKey struct { Digest digest.Digest `json:"digest"` Topic string `json:"topic"` Partition int64 `json:"partition"` ID string `json:"id"` Order int64 `json:"order"` }
func ParseRefsEtcdKey ¶
func ParseRefsEtcdKey(value string) (*RefsEtcdKey, error)
func (*RefsEtcdKey) String ¶
func (k *RefsEtcdKey) String() (res string)
type TopicEtcdKey ¶
func ParseTopicEtcdKey ¶
func ParseTopicEtcdKey(value string) (*TopicEtcdKey, error)
func (*TopicEtcdKey) String ¶
func (k *TopicEtcdKey) String() (res string)
type TopicsCollection ¶
type TopicsCollection struct {
EtcdCollection
}
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction(ctx context.Context, cfg *config.Config) *Transaction
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
func (*Transaction) Delete ¶
func (t *Transaction) Delete(key EtcdKey)
func (*Transaction) Put ¶
func (t *Transaction) Put(key EtcdKey, value string)
Click to show internal directories.
Click to hide internal directories.