worker

package
v0.0.0-...-d892afd Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pkg_api_v1_worker_worker_proto protoreflect.FileDescriptor
View Source
var Worker_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protobuf.Worker",
	HandlerType: (*WorkerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "UpdateWork",
			Handler:    _Worker_UpdateWork_Handler,
		},
		{
			MethodName: "Deregister",
			Handler:    _Worker_Deregister_Handler,
		},
		{
			MethodName: "GetGitRepo",
			Handler:    _Worker_GetGitRepo_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetWork",
			Handler:       _Worker_GetWork_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "StreamBinary",
			Handler:       _Worker_StreamBinary_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "StreamLogs",
			Handler:       _Worker_StreamLogs_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "pkg/api/v1/worker/worker.proto",
}

Worker_ServiceDesc is the grpc.ServiceDesc for Worker service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterWorkerServer

func RegisterWorkerServer(s grpc.ServiceRegistrar, srv WorkerServer)

Types

type Argument

type Argument struct {
	Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	Type        string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Key         string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	Value       string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Argument represents one argument from a job.

func (*Argument) Descriptor deprecated

func (*Argument) Descriptor() ([]byte, []int)

Deprecated: Use Argument.ProtoReflect.Descriptor instead.

func (*Argument) GetDescription

func (x *Argument) GetDescription() string

func (*Argument) GetKey

func (x *Argument) GetKey() string

func (*Argument) GetType

func (x *Argument) GetType() string

func (*Argument) GetValue

func (x *Argument) GetValue() string

func (*Argument) ProtoMessage

func (*Argument) ProtoMessage()

func (*Argument) ProtoReflect

func (x *Argument) ProtoReflect() protoreflect.Message

func (*Argument) Reset

func (x *Argument) Reset()

func (*Argument) String

func (x *Argument) String() string

type FileChunk

type FileChunk struct {
	Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"`
	// contains filtered or unexported fields
}

FileChunk represents one chunk of a file.

func (*FileChunk) Descriptor deprecated

func (*FileChunk) Descriptor() ([]byte, []int)

Deprecated: Use FileChunk.ProtoReflect.Descriptor instead.

func (*FileChunk) GetChunk

func (x *FileChunk) GetChunk() []byte

func (*FileChunk) ProtoMessage

func (*FileChunk) ProtoMessage()

func (*FileChunk) ProtoReflect

func (x *FileChunk) ProtoReflect() protoreflect.Message

func (*FileChunk) Reset

func (x *FileChunk) Reset()

func (*FileChunk) String

func (x *FileChunk) String() string

type GitRepo

type GitRepo struct {
	PrivateKey     *PrivateKey `protobuf:"bytes,1,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
	Username       string      `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Password       string      `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	Url            string      `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`
	SelectedBranch string      `protobuf:"bytes,5,opt,name=selected_branch,json=selectedBranch,proto3" json:"selected_branch,omitempty"`
	Branches       []string    `protobuf:"bytes,6,rep,name=branches,proto3" json:"branches,omitempty"`
	Localdest      string      `protobuf:"bytes,7,opt,name=localdest,proto3" json:"localdest,omitempty"`
	// contains filtered or unexported fields
}

GitRepo is a git repo.

func (*GitRepo) Descriptor deprecated

func (*GitRepo) Descriptor() ([]byte, []int)

Deprecated: Use GitRepo.ProtoReflect.Descriptor instead.

func (*GitRepo) GetBranches

func (x *GitRepo) GetBranches() []string

func (*GitRepo) GetLocaldest

func (x *GitRepo) GetLocaldest() string

func (*GitRepo) GetPassword

func (x *GitRepo) GetPassword() string

func (*GitRepo) GetPrivateKey

func (x *GitRepo) GetPrivateKey() *PrivateKey

func (*GitRepo) GetSelectedBranch

func (x *GitRepo) GetSelectedBranch() string

func (*GitRepo) GetUrl

func (x *GitRepo) GetUrl() string

func (*GitRepo) GetUsername

func (x *GitRepo) GetUsername() string

func (*GitRepo) ProtoMessage

func (*GitRepo) ProtoMessage()

func (*GitRepo) ProtoReflect

func (x *GitRepo) ProtoReflect() protoreflect.Message

func (*GitRepo) Reset

func (x *GitRepo) Reset()

func (*GitRepo) String

func (x *GitRepo) String() string

type Job

type Job struct {
	UniqueId    uint32      `protobuf:"varint,1,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"`
	Title       string      `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Description string      `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	DependsOn   []*Job      `protobuf:"bytes,4,rep,name=depends_on,json=dependsOn,proto3" json:"depends_on,omitempty"`
	Status      string      `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
	Args        []*Argument `protobuf:"bytes,6,rep,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

Job represents one job from a pipeline run.

func (*Job) Descriptor deprecated

func (*Job) Descriptor() ([]byte, []int)

Deprecated: Use Job.ProtoReflect.Descriptor instead.

func (*Job) GetArgs

func (x *Job) GetArgs() []*Argument

func (*Job) GetDependsOn

func (x *Job) GetDependsOn() []*Job

func (*Job) GetDescription

func (x *Job) GetDescription() string

func (*Job) GetStatus

func (x *Job) GetStatus() string

func (*Job) GetTitle

func (x *Job) GetTitle() string

func (*Job) GetUniqueId

func (x *Job) GetUniqueId() uint32

func (*Job) ProtoMessage

func (*Job) ProtoMessage()

func (*Job) ProtoReflect

func (x *Job) ProtoReflect() protoreflect.Message

func (*Job) Reset

func (x *Job) Reset()

func (*Job) String

func (x *Job) String() string

type LogChunk

type LogChunk struct {
	RunId      int64  `protobuf:"varint,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
	PipelineId int64  `protobuf:"varint,2,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"`
	Chunk      []byte `protobuf:"bytes,3,opt,name=chunk,proto3" json:"chunk,omitempty"`
	// contains filtered or unexported fields
}

LogChunk represents one chunk of a log file.

func (*LogChunk) Descriptor deprecated

func (*LogChunk) Descriptor() ([]byte, []int)

Deprecated: Use LogChunk.ProtoReflect.Descriptor instead.

func (*LogChunk) GetChunk

func (x *LogChunk) GetChunk() []byte

func (*LogChunk) GetPipelineId

func (x *LogChunk) GetPipelineId() int64

func (*LogChunk) GetRunId

func (x *LogChunk) GetRunId() int64

func (*LogChunk) ProtoMessage

func (*LogChunk) ProtoMessage()

func (*LogChunk) ProtoReflect

func (x *LogChunk) ProtoReflect() protoreflect.Message

func (*LogChunk) Reset

func (x *LogChunk) Reset()

func (*LogChunk) String

func (x *LogChunk) String() string

type PipelineID

type PipelineID struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*PipelineID) Descriptor deprecated

func (*PipelineID) Descriptor() ([]byte, []int)

Deprecated: Use PipelineID.ProtoReflect.Descriptor instead.

func (*PipelineID) GetId

func (x *PipelineID) GetId() int64

func (*PipelineID) ProtoMessage

func (*PipelineID) ProtoMessage()

func (*PipelineID) ProtoReflect

func (x *PipelineID) ProtoReflect() protoreflect.Message

func (*PipelineID) Reset

func (x *PipelineID) Reset()

func (*PipelineID) String

func (x *PipelineID) String() string

type PipelineRun

type PipelineRun struct {
	UniqueId     string `protobuf:"bytes,1,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"`
	Id           int64  `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	Status       string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	StartDate    int64  `protobuf:"varint,4,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"`
	FinishDate   int64  `protobuf:"varint,5,opt,name=finish_date,json=finishDate,proto3" json:"finish_date,omitempty"`
	ScheduleDate int64  `protobuf:"varint,6,opt,name=schedule_date,json=scheduleDate,proto3" json:"schedule_date,omitempty"`
	PipelineId   int64  `protobuf:"varint,7,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"`
	PipelineName string `protobuf:"bytes,8,opt,name=pipeline_name,json=pipelineName,proto3" json:"pipeline_name,omitempty"`
	PipelineType string `protobuf:"bytes,9,opt,name=pipeline_type,json=pipelineType,proto3" json:"pipeline_type,omitempty"`
	ShaSum       []byte `protobuf:"bytes,10,opt,name=sha_sum,json=shaSum,proto3" json:"sha_sum,omitempty"`
	Jobs         []*Job `protobuf:"bytes,11,rep,name=jobs,proto3" json:"jobs,omitempty"`
	Docker       bool   `protobuf:"varint,12,opt,name=docker,proto3" json:"docker,omitempty"`
	// contains filtered or unexported fields
}

PipelineRun represents one pipeline run.

func (*PipelineRun) Descriptor deprecated

func (*PipelineRun) Descriptor() ([]byte, []int)

Deprecated: Use PipelineRun.ProtoReflect.Descriptor instead.

func (*PipelineRun) GetDocker

func (x *PipelineRun) GetDocker() bool

func (*PipelineRun) GetFinishDate

func (x *PipelineRun) GetFinishDate() int64

func (*PipelineRun) GetId

func (x *PipelineRun) GetId() int64

func (*PipelineRun) GetJobs

func (x *PipelineRun) GetJobs() []*Job

func (*PipelineRun) GetPipelineId

func (x *PipelineRun) GetPipelineId() int64

func (*PipelineRun) GetPipelineName

func (x *PipelineRun) GetPipelineName() string

func (*PipelineRun) GetPipelineType

func (x *PipelineRun) GetPipelineType() string

func (*PipelineRun) GetScheduleDate

func (x *PipelineRun) GetScheduleDate() int64

func (*PipelineRun) GetShaSum

func (x *PipelineRun) GetShaSum() []byte

func (*PipelineRun) GetStartDate

func (x *PipelineRun) GetStartDate() int64

func (*PipelineRun) GetStatus

func (x *PipelineRun) GetStatus() string

func (*PipelineRun) GetUniqueId

func (x *PipelineRun) GetUniqueId() string

func (*PipelineRun) ProtoMessage

func (*PipelineRun) ProtoMessage()

func (*PipelineRun) ProtoReflect

func (x *PipelineRun) ProtoReflect() protoreflect.Message

func (*PipelineRun) Reset

func (x *PipelineRun) Reset()

func (*PipelineRun) String

func (x *PipelineRun) String() string

type PrivateKey

type PrivateKey struct {
	Key      string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

PrivateKey represents a key.

func (*PrivateKey) Descriptor deprecated

func (*PrivateKey) Descriptor() ([]byte, []int)

Deprecated: Use PrivateKey.ProtoReflect.Descriptor instead.

func (*PrivateKey) GetKey

func (x *PrivateKey) GetKey() string

func (*PrivateKey) GetPassword

func (x *PrivateKey) GetPassword() string

func (*PrivateKey) GetUsername

func (x *PrivateKey) GetUsername() string

func (*PrivateKey) ProtoMessage

func (*PrivateKey) ProtoMessage()

func (*PrivateKey) ProtoReflect

func (x *PrivateKey) ProtoReflect() protoreflect.Message

func (*PrivateKey) Reset

func (x *PrivateKey) Reset()

func (*PrivateKey) String

func (x *PrivateKey) String() string

type UnimplementedWorkerServer

type UnimplementedWorkerServer struct {
}

UnimplementedWorkerServer must be embedded to have forward compatible implementations.

func (UnimplementedWorkerServer) Deregister

func (UnimplementedWorkerServer) GetGitRepo

func (UnimplementedWorkerServer) GetWork

func (UnimplementedWorkerServer) StreamBinary

func (UnimplementedWorkerServer) StreamLogs

func (UnimplementedWorkerServer) UpdateWork

type UnsafeWorkerServer

type UnsafeWorkerServer interface {
	// contains filtered or unexported methods
}

UnsafeWorkerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WorkerServer will result in compilation errors.

type WorkerClient

type WorkerClient interface {
	// GetWork pulls work from the primary instance.
	GetWork(ctx context.Context, in *WorkerInstance, opts ...grpc.CallOption) (Worker_GetWorkClient, error)
	// UpdateWork updates work information at the primary instance.
	UpdateWork(ctx context.Context, in *PipelineRun, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// StreamBinary streams a pipeline binary back to a worker instance.
	StreamBinary(ctx context.Context, in *PipelineRun, opts ...grpc.CallOption) (Worker_StreamBinaryClient, error)
	// StreamLogs streams pipeline run logs to the primary instance.
	StreamLogs(ctx context.Context, opts ...grpc.CallOption) (Worker_StreamLogsClient, error)
	// Deregister deregister a registered worker from the primary instance.
	Deregister(ctx context.Context, in *WorkerInstance, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// GetGitRepo returns git repo information to the worker based on a pipeline name.
	GetGitRepo(ctx context.Context, in *PipelineID, opts ...grpc.CallOption) (*GitRepo, error)
}

WorkerClient is the client API for Worker service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewWorkerClient

func NewWorkerClient(cc grpc.ClientConnInterface) WorkerClient

type WorkerInstance

type WorkerInstance struct {
	UniqueId    string   `protobuf:"bytes,1,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"`
	WorkerSlots int32    `protobuf:"varint,2,opt,name=worker_slots,json=workerSlots,proto3" json:"worker_slots,omitempty"`
	Tags        []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

WorkerInstance represents the identity of a worker instance.

func (*WorkerInstance) Descriptor deprecated

func (*WorkerInstance) Descriptor() ([]byte, []int)

Deprecated: Use WorkerInstance.ProtoReflect.Descriptor instead.

func (*WorkerInstance) GetTags

func (x *WorkerInstance) GetTags() []string

func (*WorkerInstance) GetUniqueId

func (x *WorkerInstance) GetUniqueId() string

func (*WorkerInstance) GetWorkerSlots

func (x *WorkerInstance) GetWorkerSlots() int32

func (*WorkerInstance) ProtoMessage

func (*WorkerInstance) ProtoMessage()

func (*WorkerInstance) ProtoReflect

func (x *WorkerInstance) ProtoReflect() protoreflect.Message

func (*WorkerInstance) Reset

func (x *WorkerInstance) Reset()

func (*WorkerInstance) String

func (x *WorkerInstance) String() string

type WorkerServer

type WorkerServer interface {
	// GetWork pulls work from the primary instance.
	GetWork(*WorkerInstance, Worker_GetWorkServer) error
	// UpdateWork updates work information at the primary instance.
	UpdateWork(context.Context, *PipelineRun) (*emptypb.Empty, error)
	// StreamBinary streams a pipeline binary back to a worker instance.
	StreamBinary(*PipelineRun, Worker_StreamBinaryServer) error
	// StreamLogs streams pipeline run logs to the primary instance.
	StreamLogs(Worker_StreamLogsServer) error
	// Deregister deregister a registered worker from the primary instance.
	Deregister(context.Context, *WorkerInstance) (*emptypb.Empty, error)
	// GetGitRepo returns git repo information to the worker based on a pipeline name.
	GetGitRepo(context.Context, *PipelineID) (*GitRepo, error)
	// contains filtered or unexported methods
}

WorkerServer is the server API for Worker service. All implementations must embed UnimplementedWorkerServer for forward compatibility

type Worker_GetWorkClient

type Worker_GetWorkClient interface {
	Recv() (*PipelineRun, error)
	grpc.ClientStream
}

type Worker_GetWorkServer

type Worker_GetWorkServer interface {
	Send(*PipelineRun) error
	grpc.ServerStream
}

type Worker_StreamBinaryClient

type Worker_StreamBinaryClient interface {
	Recv() (*FileChunk, error)
	grpc.ClientStream
}

type Worker_StreamBinaryServer

type Worker_StreamBinaryServer interface {
	Send(*FileChunk) error
	grpc.ServerStream
}

type Worker_StreamLogsClient

type Worker_StreamLogsClient interface {
	Send(*LogChunk) error
	CloseAndRecv() (*emptypb.Empty, error)
	grpc.ClientStream
}

type Worker_StreamLogsServer

type Worker_StreamLogsServer interface {
	SendAndClose(*emptypb.Empty) error
	Recv() (*LogChunk, error)
	grpc.ServerStream
}

Jump to

Keyboard shortcuts

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