script

package
v0.0.0-...-d04516c Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientV1

type ClientV1 interface {
	GetConfig(ctx context.Context) (*plan.Conf, error)
	GetPlugin(ctx context.Context, name string) (*Plugin, error)
	RunPlugin(ctx context.Context, step *plan.WorkflowStep) (*report.Report, error)
	SendReport(ctx context.Context, rep *report.Report) error
	DownloadFile(ctx context.Context, fileId string) ([]byte, error)
}

Client helps to communicate with agent

type FakeClient

type FakeClient struct {
}

fake client helps to make a mock objects if you don't want implement all methods ClientV1 interface

func NewFakeClient

func NewFakeClient() *FakeClient

func (*FakeClient) DownloadFile

func (f *FakeClient) DownloadFile(ctx context.Context, fileId string) ([]byte, error)

func (*FakeClient) GetConfig

func (f *FakeClient) GetConfig(ctx context.Context) (*plan.Conf, error)

func (*FakeClient) GetPlugin

func (f *FakeClient) GetPlugin(ctx context.Context, name string) (*Plugin, error)

func (*FakeClient) RunPlugin

func (f *FakeClient) RunPlugin(ctx context.Context, step *plan.WorkflowStep) (*report.Report, error)

func (*FakeClient) SendReport

func (f *FakeClient) SendReport(ctx context.Context, rep *report.Report) error

type Plugin

type Plugin struct {
	Name     string
	Versions []string
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin(name string, client ClientV1, versions ...string) *Plugin

func (*Plugin) HasVersion

func (p *Plugin) HasVersion(version string) bool

func (*Plugin) LatestSupportedVersion

func (p *Plugin) LatestSupportedVersion(versions []string) string

func (*Plugin) LatestVersion

func (p *Plugin) LatestVersion() string

func (*Plugin) Run

func (p *Plugin) Run(ctx context.Context, version string, conf *plan.Conf) (*report.Report, error)

type RemoteClient

type RemoteClient struct {
	FakeClient // TODO (m0sth8): remove when implement all methods
	// contains filtered or unexported fields
}

func NewRemoteClient

func NewRemoteClient(transport transport.Transport) (*RemoteClient, error)

Remote client helps communicate plugins with agent through transport

func (*RemoteClient) DownloadFile

func (c *RemoteClient) DownloadFile(ctx context.Context, fileId string) ([]byte, error)

func (*RemoteClient) GetConfig

func (c *RemoteClient) GetConfig(ctx context.Context) (*plan.Conf, error)

func (*RemoteClient) GetPlugin

func (c *RemoteClient) GetPlugin(ctx context.Context, name string) (*Plugin, error)

func (*RemoteClient) Handle

func (s *RemoteClient) Handle(ctx context.Context, msg transport.Extractor) (interface{}, error)

func (*RemoteClient) RunPlugin

func (c *RemoteClient) RunPlugin(ctx context.Context, step *plan.WorkflowStep) (*report.Report, error)

func (*RemoteClient) SendReport

func (c *RemoteClient) SendReport(ctx context.Context, rep *report.Report) error

func (*RemoteClient) WaitForConnection

func (s *RemoteClient) WaitForConnection(ctx context.Context) error

type Scripter

type Scripter interface {
	Handle(context.Context, ClientV1, *plan.Conf) error
}

Jump to

Keyboard shortcuts

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