Documentation ¶
Index ¶
Constants ¶
View Source
const ProtocolType = "grpc"
ProtocolType is the type used to communicate.
View Source
const ProtocolVersion = 2
ProtocolVersion currently in use by Gaia
Variables ¶
View Source
var ( // ErrorJobNotFound is returned when a given job id was not found // locally. ErrorJobNotFound = errors.New("job not found in plugin") // ErrorExitPipeline is used to safely exit the pipeline (actually not an error). // Prevents the pipeline to be marked as 'failed'. ErrorExitPipeline = errors.New("pipeline exit requested by job") // ErrorDuplicateJob is returned when two jobs have the same title which is restricted. ErrorDuplicateJob = errors.New("duplicate job found (two jobs with same title)") )
Functions ¶
Types ¶
type GRPCServer ¶
type GRPCServer struct{}
GRPCServer is the plugin gRPC implementation.
func (GRPCServer) ExecuteJob ¶
func (GRPCServer) ExecuteJob(ctx context.Context, j *proto.Job) (*proto.JobResult, error)
ExecuteJob receives a job and executes it. Returns a JobResult object which gives information about job execution.
func (GRPCServer) GetJobs ¶
func (GRPCServer) GetJobs(empty *proto.Empty, stream proto.Plugin_GetJobsServer) error
GetJobs streams all given jobs back.
type Job ¶
type Job struct { Handler func(Arguments) error Title string Description string DependsOn []string Args Arguments Interaction *ManualInteraction }
Job represents a single job which should be executed during pipeline run. Handler is the function pointer to the function which will be executed.
type ManualInteraction ¶
ManualInteraction represents a manual interaction which can be set per job. Before the related job is executed, the manual interaction is displayed to the Gaia user.
Click to show internal directories.
Click to hide internal directories.