contracts

package
v0.2.0-alpha.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionType_name = map[int32]string{
		0: "START_STEP_RUN",
		1: "CANCEL_STEP_RUN",
	}
	ActionType_value = map[string]int32{
		"START_STEP_RUN":  0,
		"CANCEL_STEP_RUN": 1,
	}
)

Enum value maps for ActionType.

View Source
var (
	ActionEventType_name = map[int32]string{
		0: "STEP_EVENT_TYPE_UNKNOWN",
		1: "STEP_EVENT_TYPE_STARTED",
		2: "STEP_EVENT_TYPE_COMPLETED",
		3: "STEP_EVENT_TYPE_FAILED",
	}
	ActionEventType_value = map[string]int32{
		"STEP_EVENT_TYPE_UNKNOWN":   0,
		"STEP_EVENT_TYPE_STARTED":   1,
		"STEP_EVENT_TYPE_COMPLETED": 2,
		"STEP_EVENT_TYPE_FAILED":    3,
	}
)

Enum value maps for ActionEventType.

View Source
var Dispatcher_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Dispatcher",
	HandlerType: (*DispatcherServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _Dispatcher_Register_Handler,
		},
		{
			MethodName: "SendActionEvent",
			Handler:    _Dispatcher_SendActionEvent_Handler,
		},
		{
			MethodName: "Unsubscribe",
			Handler:    _Dispatcher_Unsubscribe_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Listen",
			Handler:       _Dispatcher_Listen_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "dispatcher.proto",
}

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

View Source
var File_dispatcher_proto protoreflect.FileDescriptor

Functions

func RegisterDispatcherServer

func RegisterDispatcherServer(s grpc.ServiceRegistrar, srv DispatcherServer)

Types

type ActionEvent

type ActionEvent struct {

	// the tenant id
	TenantId string `protobuf:"bytes,1,opt,name=tenantId,proto3" json:"tenantId,omitempty"`
	// the id of the worker
	WorkerId string `protobuf:"bytes,2,opt,name=workerId,proto3" json:"workerId,omitempty"`
	// the id of the job
	JobId string `protobuf:"bytes,3,opt,name=jobId,proto3" json:"jobId,omitempty"`
	// the job run id
	JobRunId string `protobuf:"bytes,4,opt,name=jobRunId,proto3" json:"jobRunId,omitempty"`
	// the id of the step
	StepId string `protobuf:"bytes,5,opt,name=stepId,proto3" json:"stepId,omitempty"`
	// the step run id
	StepRunId string `protobuf:"bytes,6,opt,name=stepRunId,proto3" json:"stepRunId,omitempty"`
	// the action id
	ActionId       string                 `protobuf:"bytes,7,opt,name=actionId,proto3" json:"actionId,omitempty"`
	EventTimestamp *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=eventTimestamp,proto3" json:"eventTimestamp,omitempty"`
	// the step event type
	EventType ActionEventType `protobuf:"varint,9,opt,name=eventType,proto3,enum=ActionEventType" json:"eventType,omitempty"`
	// the event payload
	EventPayload string `protobuf:"bytes,10,opt,name=eventPayload,proto3" json:"eventPayload,omitempty"`
	// contains filtered or unexported fields
}

func (*ActionEvent) Descriptor deprecated

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

Deprecated: Use ActionEvent.ProtoReflect.Descriptor instead.

func (*ActionEvent) GetActionId

func (x *ActionEvent) GetActionId() string

func (*ActionEvent) GetEventPayload

func (x *ActionEvent) GetEventPayload() string

func (*ActionEvent) GetEventTimestamp

func (x *ActionEvent) GetEventTimestamp() *timestamppb.Timestamp

func (*ActionEvent) GetEventType

func (x *ActionEvent) GetEventType() ActionEventType

func (*ActionEvent) GetJobId

func (x *ActionEvent) GetJobId() string

func (*ActionEvent) GetJobRunId

func (x *ActionEvent) GetJobRunId() string

func (*ActionEvent) GetStepId

func (x *ActionEvent) GetStepId() string

func (*ActionEvent) GetStepRunId

func (x *ActionEvent) GetStepRunId() string

func (*ActionEvent) GetTenantId

func (x *ActionEvent) GetTenantId() string

func (*ActionEvent) GetWorkerId

func (x *ActionEvent) GetWorkerId() string

func (*ActionEvent) ProtoMessage

func (*ActionEvent) ProtoMessage()

func (*ActionEvent) ProtoReflect

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

func (*ActionEvent) Reset

func (x *ActionEvent) Reset()

func (*ActionEvent) String

func (x *ActionEvent) String() string

type ActionEventResponse

type ActionEventResponse struct {

	// the tenant id
	TenantId string `protobuf:"bytes,1,opt,name=tenantId,proto3" json:"tenantId,omitempty"`
	// the id of the worker
	WorkerId string `protobuf:"bytes,2,opt,name=workerId,proto3" json:"workerId,omitempty"`
	// contains filtered or unexported fields
}

func (*ActionEventResponse) Descriptor deprecated

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

Deprecated: Use ActionEventResponse.ProtoReflect.Descriptor instead.

func (*ActionEventResponse) GetTenantId

func (x *ActionEventResponse) GetTenantId() string

func (*ActionEventResponse) GetWorkerId

func (x *ActionEventResponse) GetWorkerId() string

func (*ActionEventResponse) ProtoMessage

func (*ActionEventResponse) ProtoMessage()

func (*ActionEventResponse) ProtoReflect

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

func (*ActionEventResponse) Reset

func (x *ActionEventResponse) Reset()

func (*ActionEventResponse) String

func (x *ActionEventResponse) String() string

type ActionEventType

type ActionEventType int32
const (
	ActionEventType_STEP_EVENT_TYPE_UNKNOWN   ActionEventType = 0
	ActionEventType_STEP_EVENT_TYPE_STARTED   ActionEventType = 1
	ActionEventType_STEP_EVENT_TYPE_COMPLETED ActionEventType = 2
	ActionEventType_STEP_EVENT_TYPE_FAILED    ActionEventType = 3
)

func (ActionEventType) Descriptor

func (ActionEventType) Enum

func (x ActionEventType) Enum() *ActionEventType

func (ActionEventType) EnumDescriptor deprecated

func (ActionEventType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ActionEventType.Descriptor instead.

func (ActionEventType) Number

func (ActionEventType) String

func (x ActionEventType) String() string

func (ActionEventType) Type

type ActionType

type ActionType int32
const (
	ActionType_START_STEP_RUN  ActionType = 0
	ActionType_CANCEL_STEP_RUN ActionType = 1
)

func (ActionType) Descriptor

func (ActionType) Descriptor() protoreflect.EnumDescriptor

func (ActionType) Enum

func (x ActionType) Enum() *ActionType

func (ActionType) EnumDescriptor deprecated

func (ActionType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ActionType.Descriptor instead.

func (ActionType) Number

func (x ActionType) Number() protoreflect.EnumNumber

func (ActionType) String

func (x ActionType) String() string

func (ActionType) Type

type AssignedAction

type AssignedAction struct {

	// the tenant id
	TenantId string `protobuf:"bytes,1,opt,name=tenantId,proto3" json:"tenantId,omitempty"`
	// the job id
	JobId string `protobuf:"bytes,2,opt,name=jobId,proto3" json:"jobId,omitempty"`
	// the job name
	JobName string `protobuf:"bytes,3,opt,name=jobName,proto3" json:"jobName,omitempty"`
	// the job run id
	JobRunId string `protobuf:"bytes,4,opt,name=jobRunId,proto3" json:"jobRunId,omitempty"`
	// the step id
	StepId string `protobuf:"bytes,5,opt,name=stepId,proto3" json:"stepId,omitempty"`
	// the step run id
	StepRunId string `protobuf:"bytes,6,opt,name=stepRunId,proto3" json:"stepRunId,omitempty"`
	// the action id
	ActionId string `protobuf:"bytes,7,opt,name=actionId,proto3" json:"actionId,omitempty"`
	// the action type
	ActionType ActionType `protobuf:"varint,8,opt,name=actionType,proto3,enum=ActionType" json:"actionType,omitempty"`
	// the action payload
	ActionPayload string `protobuf:"bytes,9,opt,name=actionPayload,proto3" json:"actionPayload,omitempty"`
	// contains filtered or unexported fields
}

func (*AssignedAction) Descriptor deprecated

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

Deprecated: Use AssignedAction.ProtoReflect.Descriptor instead.

func (*AssignedAction) GetActionId

func (x *AssignedAction) GetActionId() string

func (*AssignedAction) GetActionPayload

func (x *AssignedAction) GetActionPayload() string

func (*AssignedAction) GetActionType

func (x *AssignedAction) GetActionType() ActionType

func (*AssignedAction) GetJobId

func (x *AssignedAction) GetJobId() string

func (*AssignedAction) GetJobName

func (x *AssignedAction) GetJobName() string

func (*AssignedAction) GetJobRunId

func (x *AssignedAction) GetJobRunId() string

func (*AssignedAction) GetStepId

func (x *AssignedAction) GetStepId() string

func (*AssignedAction) GetStepRunId

func (x *AssignedAction) GetStepRunId() string

func (*AssignedAction) GetTenantId

func (x *AssignedAction) GetTenantId() string

func (*AssignedAction) ProtoMessage

func (*AssignedAction) ProtoMessage()

func (*AssignedAction) ProtoReflect

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

func (*AssignedAction) Reset

func (x *AssignedAction) Reset()

func (*AssignedAction) String

func (x *AssignedAction) String() string

type DispatcherClient

type DispatcherClient interface {
	Register(ctx context.Context, in *WorkerRegisterRequest, opts ...grpc.CallOption) (*WorkerRegisterResponse, error)
	Listen(ctx context.Context, in *WorkerListenRequest, opts ...grpc.CallOption) (Dispatcher_ListenClient, error)
	SendActionEvent(ctx context.Context, in *ActionEvent, opts ...grpc.CallOption) (*ActionEventResponse, error)
	Unsubscribe(ctx context.Context, in *WorkerUnsubscribeRequest, opts ...grpc.CallOption) (*WorkerUnsubscribeResponse, error)
}

DispatcherClient is the client API for Dispatcher 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 NewDispatcherClient

func NewDispatcherClient(cc grpc.ClientConnInterface) DispatcherClient

type DispatcherServer

type DispatcherServer interface {
	Register(context.Context, *WorkerRegisterRequest) (*WorkerRegisterResponse, error)
	Listen(*WorkerListenRequest, Dispatcher_ListenServer) error
	SendActionEvent(context.Context, *ActionEvent) (*ActionEventResponse, error)
	Unsubscribe(context.Context, *WorkerUnsubscribeRequest) (*WorkerUnsubscribeResponse, error)
	// contains filtered or unexported methods
}

DispatcherServer is the server API for Dispatcher service. All implementations must embed UnimplementedDispatcherServer for forward compatibility

type Dispatcher_ListenClient

type Dispatcher_ListenClient interface {
	Recv() (*AssignedAction, error)
	grpc.ClientStream
}

type Dispatcher_ListenServer

type Dispatcher_ListenServer interface {
	Send(*AssignedAction) error
	grpc.ServerStream
}

type UnimplementedDispatcherServer

type UnimplementedDispatcherServer struct {
}

UnimplementedDispatcherServer must be embedded to have forward compatible implementations.

func (UnimplementedDispatcherServer) Listen

func (UnimplementedDispatcherServer) Register

func (UnimplementedDispatcherServer) SendActionEvent

type UnsafeDispatcherServer

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

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

type WorkerListenRequest

type WorkerListenRequest struct {

	// the tenant id
	TenantId string `protobuf:"bytes,1,opt,name=tenantId,proto3" json:"tenantId,omitempty"`
	// the id of the worker
	WorkerId string `protobuf:"bytes,2,opt,name=workerId,proto3" json:"workerId,omitempty"`
	// contains filtered or unexported fields
}

func (*WorkerListenRequest) Descriptor deprecated

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

Deprecated: Use WorkerListenRequest.ProtoReflect.Descriptor instead.

func (*WorkerListenRequest) GetTenantId

func (x *WorkerListenRequest) GetTenantId() string

func (*WorkerListenRequest) GetWorkerId

func (x *WorkerListenRequest) GetWorkerId() string

func (*WorkerListenRequest) ProtoMessage

func (*WorkerListenRequest) ProtoMessage()

func (*WorkerListenRequest) ProtoReflect

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

func (*WorkerListenRequest) Reset

func (x *WorkerListenRequest) Reset()

func (*WorkerListenRequest) String

func (x *WorkerListenRequest) String() string

type WorkerRegisterRequest

type WorkerRegisterRequest struct {

	// the tenant id
	TenantId string `protobuf:"bytes,1,opt,name=tenantId,proto3" json:"tenantId,omitempty"`
	// the name of the worker
	WorkerName string `protobuf:"bytes,2,opt,name=workerName,proto3" json:"workerName,omitempty"`
	// a list of actions that this worker can run
	Actions []string `protobuf:"bytes,3,rep,name=actions,proto3" json:"actions,omitempty"`
	// (optional) the services for this worker
	Services []string `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"`
	// contains filtered or unexported fields
}

func (*WorkerRegisterRequest) Descriptor deprecated

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

Deprecated: Use WorkerRegisterRequest.ProtoReflect.Descriptor instead.

func (*WorkerRegisterRequest) GetActions

func (x *WorkerRegisterRequest) GetActions() []string

func (*WorkerRegisterRequest) GetServices

func (x *WorkerRegisterRequest) GetServices() []string

func (*WorkerRegisterRequest) GetTenantId

func (x *WorkerRegisterRequest) GetTenantId() string

func (*WorkerRegisterRequest) GetWorkerName

func (x *WorkerRegisterRequest) GetWorkerName() string

func (*WorkerRegisterRequest) ProtoMessage

func (*WorkerRegisterRequest) ProtoMessage()

func (*WorkerRegisterRequest) ProtoReflect

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

func (*WorkerRegisterRequest) Reset

func (x *WorkerRegisterRequest) Reset()

func (*WorkerRegisterRequest) String

func (x *WorkerRegisterRequest) String() string

type WorkerRegisterResponse

type WorkerRegisterResponse struct {

	// the tenant id
	TenantId string `protobuf:"bytes,1,opt,name=tenantId,proto3" json:"tenantId,omitempty"`
	// the id of the worker
	WorkerId string `protobuf:"bytes,2,opt,name=workerId,proto3" json:"workerId,omitempty"`
	// the name of the worker
	WorkerName string `protobuf:"bytes,3,opt,name=workerName,proto3" json:"workerName,omitempty"`
	// contains filtered or unexported fields
}

func (*WorkerRegisterResponse) Descriptor deprecated

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

Deprecated: Use WorkerRegisterResponse.ProtoReflect.Descriptor instead.

func (*WorkerRegisterResponse) GetTenantId

func (x *WorkerRegisterResponse) GetTenantId() string

func (*WorkerRegisterResponse) GetWorkerId

func (x *WorkerRegisterResponse) GetWorkerId() string

func (*WorkerRegisterResponse) GetWorkerName

func (x *WorkerRegisterResponse) GetWorkerName() string

func (*WorkerRegisterResponse) ProtoMessage

func (*WorkerRegisterResponse) ProtoMessage()

func (*WorkerRegisterResponse) ProtoReflect

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

func (*WorkerRegisterResponse) Reset

func (x *WorkerRegisterResponse) Reset()

func (*WorkerRegisterResponse) String

func (x *WorkerRegisterResponse) String() string

type WorkerUnsubscribeRequest

type WorkerUnsubscribeRequest struct {

	// the tenant id to unsubscribe from
	TenantId string `protobuf:"bytes,1,opt,name=tenantId,proto3" json:"tenantId,omitempty"`
	// the id of the worker
	WorkerId string `protobuf:"bytes,2,opt,name=workerId,proto3" json:"workerId,omitempty"`
	// contains filtered or unexported fields
}

func (*WorkerUnsubscribeRequest) Descriptor deprecated

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

Deprecated: Use WorkerUnsubscribeRequest.ProtoReflect.Descriptor instead.

func (*WorkerUnsubscribeRequest) GetTenantId

func (x *WorkerUnsubscribeRequest) GetTenantId() string

func (*WorkerUnsubscribeRequest) GetWorkerId

func (x *WorkerUnsubscribeRequest) GetWorkerId() string

func (*WorkerUnsubscribeRequest) ProtoMessage

func (*WorkerUnsubscribeRequest) ProtoMessage()

func (*WorkerUnsubscribeRequest) ProtoReflect

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

func (*WorkerUnsubscribeRequest) Reset

func (x *WorkerUnsubscribeRequest) Reset()

func (*WorkerUnsubscribeRequest) String

func (x *WorkerUnsubscribeRequest) String() string

type WorkerUnsubscribeResponse

type WorkerUnsubscribeResponse struct {

	// the tenant id to unsubscribe from
	TenantId string `protobuf:"bytes,1,opt,name=tenantId,proto3" json:"tenantId,omitempty"`
	// the id of the worker
	WorkerId string `protobuf:"bytes,2,opt,name=workerId,proto3" json:"workerId,omitempty"`
	// contains filtered or unexported fields
}

func (*WorkerUnsubscribeResponse) Descriptor deprecated

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

Deprecated: Use WorkerUnsubscribeResponse.ProtoReflect.Descriptor instead.

func (*WorkerUnsubscribeResponse) GetTenantId

func (x *WorkerUnsubscribeResponse) GetTenantId() string

func (*WorkerUnsubscribeResponse) GetWorkerId

func (x *WorkerUnsubscribeResponse) GetWorkerId() string

func (*WorkerUnsubscribeResponse) ProtoMessage

func (*WorkerUnsubscribeResponse) ProtoMessage()

func (*WorkerUnsubscribeResponse) ProtoReflect

func (*WorkerUnsubscribeResponse) Reset

func (x *WorkerUnsubscribeResponse) Reset()

func (*WorkerUnsubscribeResponse) String

func (x *WorkerUnsubscribeResponse) String() string

Jump to

Keyboard shortcuts

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