cfopsplugin

package
v2.1.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2016 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//PluginMeta - default plugin arg to show meta data
	PluginMeta = "plugin-meta"
)

Variables

View Source
var NewPivotalCF = func(installationSettings cfbackup.InstallationSettings, ts tileregistry.TileSpec) PivotalCF {

	return &DefaultPivotalCF{
		TileSpec:             ts,
		InstallationSettings: installationSettings,
	}
}

NewPivotalCF - creates the default pivotacf

View Source
var (
	//UIOutput - a function to control UIOutput
	UIOutput = fmt.Print
)

Functions

func GetHandshake

func GetHandshake() plugin.HandshakeConfig

GetHandshake - gets the handshake object

func GetPlugins

func GetPlugins() map[string]plugin.Plugin

GetPlugins - returns the list of registered plugins

func RegisterPlugin

func RegisterPlugin(name string, plugin BackupRestorer)

RegisterPlugin - register a plugin as available

func Start

func Start(plgn Plugin)

Start - takes a given plugin and starts it

Types

type BackupRestorePlugin

type BackupRestorePlugin struct {
	P BackupRestorer
}

BackupRestorePlugin - this is an implementation of the rpc client and server wrapper

func (BackupRestorePlugin) Client

func (g BackupRestorePlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

Client --

func (BackupRestorePlugin) Server

func (g BackupRestorePlugin) Server(*plugin.MuxBroker) (interface{}, error)

Server --

type BackupRestoreRPC

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

BackupRestoreRPC - is an implementation of a client that talks over RPC

func (*BackupRestoreRPC) Backup

func (g *BackupRestoreRPC) Backup() (err error)

Backup --

func (*BackupRestoreRPC) Restore

func (g *BackupRestoreRPC) Restore() (err error)

Restore --

func (*BackupRestoreRPC) Setup

func (g *BackupRestoreRPC) Setup(pcf PivotalCF) error

Restore --

type BackupRestoreRPCServer

type BackupRestoreRPCServer struct {
	Impl BackupRestorer
}

BackupRestoreRPCServer - this is an implementation of the rpc server for a backuprestorer

func (*BackupRestoreRPCServer) Backup

func (s *BackupRestoreRPCServer) Backup(args interface{}, resp *error) error

Backup --

func (*BackupRestoreRPCServer) Restore

func (s *BackupRestoreRPCServer) Restore(args interface{}, resp *error) error

Restore --

func (*BackupRestoreRPCServer) Setup

func (s *BackupRestoreRPCServer) Setup(pcf PivotalCF, resp *error) error

Restore --

type BackupRestorer

type BackupRestorer interface {
	Backup() error
	Restore() error
	Setup(PivotalCF) error
}

BackupRestorer - is the interface that we're exposing as a plugin.

func Call

func Call(name string, filePath string) (BackupRestorer, *plugin.Client)

Call - calls a given plugin by name and file path

type DefaultPivotalCF

type DefaultPivotalCF struct {
	TileSpec             tileregistry.TileSpec
	InstallationSettings cfbackup.InstallationSettings
}

DefaultPivotalCF - default implementation of PivotalCF interface

func (*DefaultPivotalCF) GetHostDetails

func (s *DefaultPivotalCF) GetHostDetails() tileregistry.TileSpec

GetHostDetails - return all of the host and archive details in the form of a tile spec object

func (*DefaultPivotalCF) GetInstallationSettings

func (s *DefaultPivotalCF) GetInstallationSettings() cfbackup.InstallationSettings

GetInstallationSettings - return installation settings

func (*DefaultPivotalCF) NewArchiveReader

func (s *DefaultPivotalCF) NewArchiveReader(name string) (reader io.ReadCloser, err error)

NewArchiveReader - creates a reader to a named resource using the given name on the cfops defined target (s3, local, etc)

func (*DefaultPivotalCF) NewArchiveWriter

func (s *DefaultPivotalCF) NewArchiveWriter(name string) (writer io.WriteCloser, err error)

NewArchiveWriter - creates a writer to a named resource using the given name on the cfops defined target (s3, local, etc)

type Meta

type Meta struct {
	Name                string
	Role                string
	Description         string
	SupportedActivities map[string]bool
}

Meta - plugin meta data storage object

type PivotalCF

type PivotalCF interface {
	GetHostDetails() tileregistry.TileSpec
	NewArchiveReader(name string) (io.ReadCloser, error)
	NewArchiveWriter(name string) (io.WriteCloser, error)
	GetInstallationSettings() cfbackup.InstallationSettings
}

PivotalCF - interface representing a pivotalcf

type Plugin

type Plugin interface {
	BackupRestorer
	GetMeta() Meta
}

Plugin - is a interface plugin providers should implement

type PluginTileBuilder

type PluginTileBuilder struct {
	FilePath string
	Meta     Meta
}

PluginTileBuilder - factory for a tile wrapped plugin

func (*PluginTileBuilder) New

func (s *PluginTileBuilder) New(tileSpec tileregistry.TileSpec) (tile tileregistry.Tile, err error)

New - method to create a plugin tile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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