metadata

package
Version: v0.0.0-...-9af805d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2016 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

type ClusterEtcdKey struct {
	Group string `json:"group"`
	Node  string `json:"node"`
}

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 NewBlobsCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)

func NewNodesCollection

func NewNodesCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)

func NewQueuesCollection

func NewQueuesCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)

func NewRefsCollection

func NewRefsCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)

func NewTopicsCollection

func NewTopicsCollection(ctx context.Context, cfg *config.Config) (EtcdCollection, error)

type EtcdKey

type EtcdKey interface {
	String() string
}

type EtcdValue

type EtcdValue struct {
	RawKey string
	Value  string
	Count  int64
}

type GetOption

type GetOption int

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
}

func (*QueuesCollection) Create

func (b *QueuesCollection) Create(key EtcdKey, value string) (EtcdKey, error)

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

type TopicEtcdKey struct {
	Topic     string `json:"topic"`
	Partition int64  `json:"partition"`
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL