mprovider

package
v4.15.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MaxAnnKeyLength = 64
View Source
const MaxAnnValLength = 256
View Source
const MaxCollectionLength = 256
View Source
const MaxListCollections = 10000
View Source
const MaxTagKeyLength = 64
View Source
const MaxTagValLength = 256
View Source
const MaximumAnnotations = 64
View Source
const MaximumTags = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type FullRecord

type FullRecord struct {
	Collection string            `msg:"c"`
	Tags       map[string]string `msg:"t"`
	Anns       map[string]string `msg:"a"`
}

func (*FullRecord) DecodeMsg

func (z *FullRecord) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*FullRecord) EncodeMsg

func (z *FullRecord) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*FullRecord) MarshalMsg

func (z *FullRecord) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*FullRecord) Msgsize

func (z *FullRecord) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*FullRecord) Serialize

func (fr *FullRecord) Serialize() []byte

func (*FullRecord) UnmarshalMsg

func (z *FullRecord) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type LookupResult

type LookupResult struct {
	UUID              []byte
	Collection        string
	Tags              map[string]string
	Annotations       map[string]string
	AnnotationVersion uint64
}

func (*LookupResult) String

func (lr *LookupResult) String() string

type MProvider

type MProvider interface {

	// Sets the stream annotations. An entry with a nil string implies delete
	SetStreamAnnotations(ctx context.Context, uuid []byte, aver uint64, changes map[string]*string) bte.BTE

	// Get a stream annotations and tags
	GetStreamInfo(ctx context.Context, uuid []byte) (res *LookupResult, err bte.BTE)

	// CreateStream makes a stream with the given uuid, collection and tags. Returns
	// an error if the uuid already exists.
	CreateStream(ctx context.Context, uuid []byte, collection string, tags map[string]string, annotations map[string]string) bte.BTE

	// DeleteStream tombstones a stream
	DeleteStream(ctx context.Context, uuid []byte) bte.BTE

	// ListCollections returns a list of collections beginning with prefix (which may be "")
	// and starting from the given string. If number is > 0, only that many results
	// will be returned. More can be obtained by re-calling ListCollections with
	// a given startingFrom and number.
	ListCollections(ctx context.Context, prefix string, startingFrom string, limit uint64) ([]string, bte.BTE)

	// Return back all streams in all collections beginning with collection (or exactly equal if prefix is false)
	// provided they have the given tags and annotations, where a nil entry in the map means has the tag but the value is irrelevant
	LookupStreams(ctx context.Context, collection string, isCollectionPrefix bool, tags map[string]*string, annotations map[string]*string) (chan *LookupResult, chan bte.BTE)

	// Return back a list of uuids that need to be deleted in the background
	ListToDelete(ctx context.Context) ([][]byte, bte.BTE)

	// Remove the given list of uuids from the background deletion queue
	ClearToDelete(ctx context.Context, uuids [][]byte) bte.BTE

	// Get which tags and annotations are in use in the given collection prefix
	GetKeyUsage(ctx context.Context, collectionPrefix string) (map[string]int, map[string]int, bte.BTE)
}

func NewEtcdMetadataProvider

func NewEtcdMetadataProvider(pfx string, client *etcd.Client) MProvider

Jump to

Keyboard shortcuts

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