service

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package service implements the gRPC service for plugins so plugins can just implement the plugin.Interface and related interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskExecution

type TaskExecution struct {
	api.UnimplementedTaskExecutionServer

	Impl plugin.Interface
	// contains filtered or unexported fields
}

TaskExecution implements api.TaskExecutionServer and maps incoming gRPC service calls to the plugin.Interface.

func NewGRPCTaskExecution

func NewGRPCTaskExecution(
	logger hclog.Logger,
	impl plugin.Interface,
) *TaskExecution

NewGRPCTaskExecution returns a new TaskExecution object that will map incoming gRPC service calls to a plugin.Interface implementation.

func (*TaskExecution) Cancel

Cancel implements the Cancel gRPC service method and performs final cleanup necessary for cancelling a task.

func (*TaskExecution) Complete

Complete implements the Complete gRPC service method and performs final cleanup necessary for completing a task.

func (*TaskExecution) ExecuteBegin

func (*TaskExecution) ExecuteCheck

func (*TaskExecution) ExecuteEnd

func (*TaskExecution) ExecuteFinish

func (*TaskExecution) ExecuteRun

func (*TaskExecution) Goal

Goal maps the gRPC Goal service method to the Goal method of plugin.Interface.

func (*TaskExecution) Implements

Implements maps the gRPC Implements service method to the Implements method of plugin.Interface.

func (*TaskExecution) Prepare

Prepare maps the gRPC Prepare service method to the Prepare method of plugin.Interface.

func (*TaskExecution) PrepareBegin

func (s *TaskExecution) PrepareBegin(
	ctx context.Context,
	ref *api.Task_Ref,
) (*api.Task_SubStage_Response, error)

func (*TaskExecution) PrepareEnd

func (s *TaskExecution) PrepareEnd(
	ctx context.Context,
	ref *api.Task_Ref,
) (*api.Task_SubStage_Response, error)

func (*TaskExecution) PrepareRun

func (s *TaskExecution) PrepareRun(
	ctx context.Context,
	ref *api.Task_Ref,
) (*api.Task_SubStage_Response, error)

type TaskState

type TaskState struct {
	// Task is the plugin.Task object that is being executed for this task state.
	Task plugin.Task

	// Context is the plugin.Context used when executing this task.
	Context *plugin.Context
}

TaskState is used to track the task state for a running plugin task.

Jump to

Keyboard shortcuts

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