client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package client implements the gRPC client used by the zedpm master process to communicate with all the plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyChanges added in v0.1.0

func ApplyChanges(ctx context.Context, changes map[string]string)

func KV added in v0.1.0

func KV(ctx context.Context) *storage.KVCon

func ListAdded added in v0.1.0

func ListAdded(ctx context.Context) []string

func ToAdd added in v0.1.0

func ToAdd(ctx context.Context, files []string)

func WithContext added in v0.1.0

func WithContext(
	ctx context.Context,
	cctx Context,
) context.Context

Types

type Context added in v0.1.0

type Context interface {
	KV() *storage.KVCon
	ApplyChanges(map[string]string)
	ListAdded() []string
	ToAdd([]string)
}

type ContextKey added in v0.1.0

type ContextKey struct{}

type Interface

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

Interface implements plugin.Interface to map calls to that interface onto calls to the api.TaskExecutionClient.

func NewGRPCTaskInterface

func NewGRPCTaskInterface(client api.TaskExecutionClient) *Interface

NewGRPCTaskInterface returns a new plugin.Interface wrapper around api.TaskExecutionClient.

func (*Interface) Cancel

func (c *Interface) Cancel(
	ctx context.Context,
	task plugin.Task,
) error

Cancel calls the Cancel gRPC srvice method.

func (*Interface) Complete

func (c *Interface) Complete(
	ctx context.Context,
	task plugin.Task,
) error

Complete calls the Complete gRPC method.

func (*Interface) Goal

func (c *Interface) Goal(
	ctx context.Context,
	goalName string,
) (plugin.GoalDescription, error)

Goal calls the Goal gRPC service method.

func (*Interface) Implements

func (c *Interface) Implements(
	ctx context.Context,
) ([]plugin.TaskDescription, error)

Implements calls the Implements gRPC service method.

func (*Interface) Prepare

func (c *Interface) Prepare(
	ctx context.Context,
	taskName string,
) (plugin.Task, error)

Prepare calls the Prepare gRPC service method.

type Operation

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

Operation implements plugin.OperationHandler, which makes calls to the api.TaskExecutionClient gRPC client.

func (*Operation) Call

func (o *Operation) Call(ctx context.Context) error

Call executes the operaiton by calling one of the Execute* gRPC service methods.

type Task

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

Task implements the plugin.Task interface, which makes calls to the gRPC service defined by api.TaskExecutionClient.

func (*Task) Begin

func (t *Task) Begin(ctx context.Context) (plugin.Operations, error)

Begin calls the gRPC PrepareBegin method and returns operations that, when called, will call the gRPC ExecuteBegin service method.

func (*Task) Check

func (t *Task) Check(
	ctx context.Context,
) error

Check calls the ExecuteCheck gRPC service method.

func (*Task) End

func (t *Task) End(ctx context.Context) (plugin.Operations, error)

End calls the gRPC PrepareEnd method and returns operations that, when called, will call the gRPC ExecuteEnd service method.

func (*Task) Finish

func (t *Task) Finish(
	ctx context.Context,
) error

Finish calls the ExecuteFinish gRCP service method.

func (*Task) Run

func (t *Task) Run(ctx context.Context) (plugin.Operations, error)

Run calls the gRPC PrepareRun method and returns operations that, when called, will call the gRPC ExecuteRun service method.

func (*Task) Setup

func (t *Task) Setup(
	_ context.Context,
) error

Setup is a no-op since the api.TaskExecutionClient does not provide this functionality.

func (*Task) Teardown

func (t *Task) Teardown(
	_ context.Context,
) error

Teardown is a no-op as the gRPC client does not implement this function.

Jump to

Keyboard shortcuts

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