plugin

package
v0.0.0-...-20af522 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Types = []Type{
	TypeBackend,
}

Types is a wrapper around plugin type constants for discovery purposes.

View Source
var VersionedPlugins = map[int]plugin.PluginSet{
	1: {
		"backend": &BackendPlugin{},
	},
}

VersionedPlugins is a map of PluginSets used to negotiate a compatible version between stori and plugin servers.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Broker *plugin.MuxBroker
	Client *rpc.Client
}

Backend is an implementation of stori.Backend that communicates over RPC.

type BackendPlugin

type BackendPlugin struct {
	Backend func() stori.Backend
}

BackendPlugin implements plugin.Plugin.

func (*BackendPlugin) Client

func (be *BackendPlugin) Client(
	broker *plugin.MuxBroker,
	c *rpc.Client,
) (interface{}, error)

Client returns client used to interact with the backend server.

func (*BackendPlugin) Server

func (be *BackendPlugin) Server(broker *plugin.MuxBroker) (interface{}, error)

Server returns a backend that can communicates via RPC.

type BackendServer

type BackendServer struct {
	Broker  *plugin.MuxBroker
	Backend stori.Backend
}

BackendServer is a net/rpc compatible structure for serving a backend.

type BlobStore

type BlobStore struct {
	Broker *plugin.MuxBroker
	Client *rpc.Client
}

BlobStore is an implementation of stori.BlobStore that communicates over RPC.

type BlobStorePlugin

type BlobStorePlugin struct {
	BlobStore func() stori.BlobStore
}

BlobStorePlugin implements plugin.Plugin.

func (*BlobStorePlugin) Client

func (bs *BlobStorePlugin) Client()

Client returns client used to interact with the blobstore server.

func (*BlobStorePlugin) Server

func (bs *BlobStorePlugin) Server(
	broker *plugin.MuxBroker,
) (interface{}, error)

Server returns a blobstore that can communicates via RPC.

type BlobStoreServer

type BlobStoreServer struct {
	Broker    *plugin.MuxBroker
	BlobStore stori.BlobStore
}

BlobStoreServer is a net/rpc compatible structure for serving a blobstore

type TokenAuthenticator

type TokenAuthenticator struct {
	Broker *plugin.MuxBroker
	Client *rpc.Client
}

TokenAuthenticator is an implementation of authn.TokenAuthenticator that communicates over RPC.

type TokenAuthenticatorPlugin

type TokenAuthenticatorPlugin struct {
	TokenAuthenticator func() authn.TokenAuthenticator
}

TokenAuthenticatorPlugin implements plugin.Plugin.

func (*TokenAuthenticatorPlugin) Client

func (a *TokenAuthenticatorPlugin) Client(
	broker *plugin.MuxBroker,
	c *rpc.Client,
) (interface{}, error)

Client returns a client used to interact with the authn.TokenAuthenticator server.

func (*TokenAuthenticatorPlugin) Server

func (a *TokenAuthenticatorPlugin) Server(broker *plugin.MuxBroker,
) (interface{}, error)

Server returns an authn.TokenAuthenticator that communicates via RPC.

type TokenAuthenticatorServer

type TokenAuthenticatorServer struct {
	Broker             *plugin.MuxBroker
	TokenAuthenticator authn.TokenAuthenticator
}

TokenAuthenticatorServer is a net/rpc compatible structure for serving a TokenAuthenticator.

type Type

type Type uint32

Type represents a plugin type.

const (
	TypeUnknown Type = iota
	TypeBackend
)

A list of plugin types supported by stori.

func ParseType

func ParseType(pluginType string) (Type, error)

ParseType takes a string representation of a plugin type and returns a concrete type.

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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