plugin

package
v0.0.0-...-d0f0867 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

README

KeyVal plugin

KeyVal plugin defines a skeleton to access a key-value datastore. A particular datastore plugin uses this skeleton.

API

Implements the interface:

Documentation

Overview

Package plugin contains a keyval plugin skeleton used in various key-value data store clients (e.g. etcdv3/plugin_impl_etcdv3.go, redis/plugin_impl_redis.go).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	keyval.CoreBrokerWatcher
}

Connection defines an access to a particular key-value data store implementation.

type Skeleton

type Skeleton struct {
	// contains filtered or unexported fields
}

Skeleton of a KV plugin is a generic part of KV plugin.

func NewSkeleton

func NewSkeleton(name string, serviceLabel servicelabel.ReaderAPI,
	connection Connection) *Skeleton

NewSkeleton creates a new instance of the Skeleton with the given connector. The connection is established in AfterInit phase.

func (*Skeleton) AfterInit

func (plugin *Skeleton) AfterInit() (err error)

AfterInit is called once all plugins have been initialized. The connection to datastore is established in this phase.

func (*Skeleton) Close

func (plugin *Skeleton) Close() error

Close cleans up the resources.

func (*Skeleton) Init

func (plugin *Skeleton) Init() (err error)

Init is called on plugin startup.

func (*Skeleton) NewBroker

func (plugin *Skeleton) NewBroker(keyPrefix string) keyval.ProtoBroker

NewBroker creates new instance of prefixed broker that provides API with arguments of type proto.Message.

func (*Skeleton) NewWatcher

func (plugin *Skeleton) NewWatcher(keyPrefix string) keyval.ProtoWatcher

NewWatcher creates new instance of prefixed broker that provides API with arguments of type proto.Message.

Jump to

Keyboard shortcuts

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