sdkProto

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CheckResponse_Result_name = map[int32]string{
		0: "UNKNOWN",
		1: "SUCCESS",
		2: "FAILURE",
		3: "SKIPPED",
	}
	CheckResponse_Result_value = map[string]int32{
		"UNKNOWN": 0,
		"SUCCESS": 1,
		"FAILURE": 2,
		"SKIPPED": 3,
	}
)

Enum value maps for CheckResponse_Result.

View Source
var File_sdk_proto_sdk_proto protoreflect.FileDescriptor
View Source
var Trigger_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sdkProto.Trigger",
	HandlerType: (*TriggerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Check",
			Handler:    _Trigger_Check_Handler,
		},
		{
			MethodName: "Info",
			Handler:    _Trigger_Info_Handler,
		},
		{
			MethodName: "Subscribe",
			Handler:    _Trigger_Subscribe_Handler,
		},
		{
			MethodName: "Unsubscribe",
			Handler:    _Trigger_Unsubscribe_Handler,
		},
		{
			MethodName: "Shutdown",
			Handler:    _Trigger_Shutdown_Handler,
		},
		{
			MethodName: "ExternalEvent",
			Handler:    _Trigger_ExternalEvent_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "sdk/proto/sdk.proto",
}

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

Functions

func RegisterTriggerServer

func RegisterTriggerServer(s grpc.ServiceRegistrar, srv TriggerServer)

Types

type CheckRequest

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

func (*CheckRequest) Descriptor deprecated

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

Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.

func (*CheckRequest) ProtoMessage

func (*CheckRequest) ProtoMessage()

func (*CheckRequest) ProtoReflect

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

func (*CheckRequest) Reset

func (x *CheckRequest) Reset()

func (*CheckRequest) String

func (x *CheckRequest) String() string

type CheckResponse

type CheckResponse struct {

	// The trigger can choose to give extra details about the
	// specific trigger event result.
	Details string `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
	// Unique id of trigger instance.
	PipelineTriggerLabel string `protobuf:"bytes,2,opt,name=pipeline_trigger_label,json=pipelineTriggerLabel,proto3" json:"pipeline_trigger_label,omitempty"`
	// Unique identifier for pipeline.
	PipelineId string `protobuf:"bytes,3,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"`
	// Unique identifier for namespace.
	NamespaceId string               `protobuf:"bytes,4,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"`
	Result      CheckResponse_Result `protobuf:"varint,5,opt,name=result,proto3,enum=sdkProto.CheckResponse_Result" json:"result,omitempty"`
	// Metadata is passed to the tasks as extra environment variables.
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CheckResponse) Descriptor deprecated

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

Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.

func (*CheckResponse) GetDetails

func (x *CheckResponse) GetDetails() string

func (*CheckResponse) GetMetadata

func (x *CheckResponse) GetMetadata() map[string]string

func (*CheckResponse) GetNamespaceId

func (x *CheckResponse) GetNamespaceId() string

func (*CheckResponse) GetPipelineId

func (x *CheckResponse) GetPipelineId() string

func (*CheckResponse) GetPipelineTriggerLabel

func (x *CheckResponse) GetPipelineTriggerLabel() string

func (*CheckResponse) GetResult

func (x *CheckResponse) GetResult() CheckResponse_Result

func (*CheckResponse) ProtoMessage

func (*CheckResponse) ProtoMessage()

func (*CheckResponse) ProtoReflect

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

func (*CheckResponse) Reset

func (x *CheckResponse) Reset()

func (*CheckResponse) String

func (x *CheckResponse) String() string

type CheckResponse_Result

type CheckResponse_Result int32
const (
	CheckResponse_UNKNOWN CheckResponse_Result = 0
	CheckResponse_SUCCESS CheckResponse_Result = 1
	CheckResponse_FAILURE CheckResponse_Result = 2
	CheckResponse_SKIPPED CheckResponse_Result = 3
)

func (CheckResponse_Result) Descriptor

func (CheckResponse_Result) Enum

func (CheckResponse_Result) EnumDescriptor deprecated

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

Deprecated: Use CheckResponse_Result.Descriptor instead.

func (CheckResponse_Result) Number

func (CheckResponse_Result) String

func (x CheckResponse_Result) String() string

func (CheckResponse_Result) Type

type ExternalEventRequest

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

func (*ExternalEventRequest) Descriptor deprecated

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

Deprecated: Use ExternalEventRequest.ProtoReflect.Descriptor instead.

func (*ExternalEventRequest) GetPayload

func (x *ExternalEventRequest) GetPayload() []byte

func (*ExternalEventRequest) ProtoMessage

func (*ExternalEventRequest) ProtoMessage()

func (*ExternalEventRequest) ProtoReflect

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

func (*ExternalEventRequest) Reset

func (x *ExternalEventRequest) Reset()

func (*ExternalEventRequest) String

func (x *ExternalEventRequest) String() string

type ExternalEventResponse

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

func (*ExternalEventResponse) Descriptor deprecated

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

Deprecated: Use ExternalEventResponse.ProtoReflect.Descriptor instead.

func (*ExternalEventResponse) ProtoMessage

func (*ExternalEventResponse) ProtoMessage()

func (*ExternalEventResponse) ProtoReflect

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

func (*ExternalEventResponse) Reset

func (x *ExternalEventResponse) Reset()

func (*ExternalEventResponse) String

func (x *ExternalEventResponse) String() string

type InfoRequest

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

func (*InfoRequest) Descriptor deprecated

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

Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.

func (*InfoRequest) ProtoMessage

func (*InfoRequest) ProtoMessage()

func (*InfoRequest) ProtoReflect

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

func (*InfoRequest) Reset

func (x *InfoRequest) Reset()

func (*InfoRequest) String

func (x *InfoRequest) String() string

type InfoResponse

type InfoResponse struct {

	// kind corresponds a unique trigger identifier, this is passed as a envvar
	// via the main process(and as such can be left empty), as the main process
	// container the configuration for which trigger "kind" corresponds to which
	// trigger container.
	Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
	// Triggers are allowed to provide a link to more extensive documentation on
	// how to use and configure them.
	Documentation string `protobuf:"bytes,2,opt,name=documentation,proto3" json:"documentation,omitempty"`
	// contains filtered or unexported fields
}

func (*InfoResponse) Descriptor deprecated

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

Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.

func (*InfoResponse) GetDocumentation

func (x *InfoResponse) GetDocumentation() string

func (*InfoResponse) GetKind

func (x *InfoResponse) GetKind() string

func (*InfoResponse) ProtoMessage

func (*InfoResponse) ProtoMessage()

func (*InfoResponse) ProtoReflect

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

func (*InfoResponse) Reset

func (x *InfoResponse) Reset()

func (*InfoResponse) String

func (x *InfoResponse) String() string

type ShutdownRequest

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

func (*ShutdownRequest) Descriptor deprecated

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

Deprecated: Use ShutdownRequest.ProtoReflect.Descriptor instead.

func (*ShutdownRequest) ProtoMessage

func (*ShutdownRequest) ProtoMessage()

func (*ShutdownRequest) ProtoReflect

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

func (*ShutdownRequest) Reset

func (x *ShutdownRequest) Reset()

func (*ShutdownRequest) String

func (x *ShutdownRequest) String() string

type ShutdownResponse

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

func (*ShutdownResponse) Descriptor deprecated

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

Deprecated: Use ShutdownResponse.ProtoReflect.Descriptor instead.

func (*ShutdownResponse) ProtoMessage

func (*ShutdownResponse) ProtoMessage()

func (*ShutdownResponse) ProtoReflect

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

func (*ShutdownResponse) Reset

func (x *ShutdownResponse) Reset()

func (*ShutdownResponse) String

func (x *ShutdownResponse) String() string

type SubscribeRequest

type SubscribeRequest struct {

	// pipeline specific subscription id
	PipelineTriggerLabel string `protobuf:"bytes,1,opt,name=pipeline_trigger_label,json=pipelineTriggerLabel,proto3" json:"pipeline_trigger_label,omitempty"`
	NamespaceId          string `protobuf:"bytes,2,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` // unique identifier for associated namespace
	PipelineId           string `protobuf:"bytes,3,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"`    // unique identifier for associated pipeline
	// pipelines are allowed to pass a configuration to triggers denoting what
	// specific settings they might like for a specific trigger. The acceptable
	// values of this config map is defined by the triggers and should be
	// mentioned in documentation.
	//
	// Additionally, the trigger should verify config settings and pass back an
	// error when it does not meet requirements.
	Config map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*SubscribeRequest) Descriptor deprecated

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

Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.

func (*SubscribeRequest) GetConfig

func (x *SubscribeRequest) GetConfig() map[string]string

func (*SubscribeRequest) GetNamespaceId

func (x *SubscribeRequest) GetNamespaceId() string

func (*SubscribeRequest) GetPipelineId

func (x *SubscribeRequest) GetPipelineId() string

func (*SubscribeRequest) GetPipelineTriggerLabel

func (x *SubscribeRequest) GetPipelineTriggerLabel() string

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) ProtoReflect

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

func (*SubscribeRequest) Reset

func (x *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (x *SubscribeRequest) String() string

type SubscribeResponse

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

func (*SubscribeResponse) Descriptor deprecated

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

Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead.

func (*SubscribeResponse) ProtoMessage

func (*SubscribeResponse) ProtoMessage()

func (*SubscribeResponse) ProtoReflect

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

func (*SubscribeResponse) Reset

func (x *SubscribeResponse) Reset()

func (*SubscribeResponse) String

func (x *SubscribeResponse) String() string

type TriggerClient

type TriggerClient interface {
	// Check blocks until the trigger has a pipeline that should be run, then it
	// returns.
	Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
	// Info returns information on the specific plugin
	Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
	// Subscribe allows a trigger to keep track of all pipelines currently
	// dependant on that trigger so that we can trigger them at appropriate times.
	Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (*SubscribeResponse, error)
	// Unsubscribe allows pipelines to remove their trigger subscriptions. This is
	// useful if the pipeline no longer needs to be notified about a specific
	// trigger automation.
	Unsubscribe(ctx context.Context, in *UnsubscribeRequest, opts ...grpc.CallOption) (*UnsubscribeResponse, error)
	// Shutdown tells the trigger to cleanup and gracefully shutdown. If a trigger
	// does not shutdown in a time defined by the gofer API the trigger will
	// instead be Force shutdown(SIGKILL). This is to say that all triggers should
	// lean toward quick cleanups and shutdowns.
	Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error)
	// ExternalEvent are json blobs of gofer's /events endpoint. Normally
	// webhooks.
	ExternalEvent(ctx context.Context, in *ExternalEventRequest, opts ...grpc.CallOption) (*ExternalEventResponse, error)
}

TriggerClient is the client API for Trigger 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 NewTriggerClient

func NewTriggerClient(cc grpc.ClientConnInterface) TriggerClient

type TriggerServer

type TriggerServer interface {
	// Check blocks until the trigger has a pipeline that should be run, then it
	// returns.
	Check(context.Context, *CheckRequest) (*CheckResponse, error)
	// Info returns information on the specific plugin
	Info(context.Context, *InfoRequest) (*InfoResponse, error)
	// Subscribe allows a trigger to keep track of all pipelines currently
	// dependant on that trigger so that we can trigger them at appropriate times.
	Subscribe(context.Context, *SubscribeRequest) (*SubscribeResponse, error)
	// Unsubscribe allows pipelines to remove their trigger subscriptions. This is
	// useful if the pipeline no longer needs to be notified about a specific
	// trigger automation.
	Unsubscribe(context.Context, *UnsubscribeRequest) (*UnsubscribeResponse, error)
	// Shutdown tells the trigger to cleanup and gracefully shutdown. If a trigger
	// does not shutdown in a time defined by the gofer API the trigger will
	// instead be Force shutdown(SIGKILL). This is to say that all triggers should
	// lean toward quick cleanups and shutdowns.
	Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
	// ExternalEvent are json blobs of gofer's /events endpoint. Normally
	// webhooks.
	ExternalEvent(context.Context, *ExternalEventRequest) (*ExternalEventResponse, error)
	// contains filtered or unexported methods
}

TriggerServer is the server API for Trigger service. All implementations must embed UnimplementedTriggerServer for forward compatibility

type UnimplementedTriggerServer

type UnimplementedTriggerServer struct {
}

UnimplementedTriggerServer must be embedded to have forward compatible implementations.

func (UnimplementedTriggerServer) Check

func (UnimplementedTriggerServer) ExternalEvent

func (UnimplementedTriggerServer) Info

func (UnimplementedTriggerServer) Shutdown

func (UnimplementedTriggerServer) Subscribe

func (UnimplementedTriggerServer) Unsubscribe

type UnsafeTriggerServer

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

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

type UnsubscribeRequest

type UnsubscribeRequest struct {

	// pipeline specific subscription id
	PipelineTriggerLabel string `protobuf:"bytes,1,opt,name=pipeline_trigger_label,json=pipelineTriggerLabel,proto3" json:"pipeline_trigger_label,omitempty"`
	NamespaceId          string `protobuf:"bytes,2,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` // unique identifier for associated namespace
	PipelineId           string `protobuf:"bytes,3,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"`    // unique identifier for associated pipeline
	// contains filtered or unexported fields
}

func (*UnsubscribeRequest) Descriptor deprecated

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

Deprecated: Use UnsubscribeRequest.ProtoReflect.Descriptor instead.

func (*UnsubscribeRequest) GetNamespaceId

func (x *UnsubscribeRequest) GetNamespaceId() string

func (*UnsubscribeRequest) GetPipelineId

func (x *UnsubscribeRequest) GetPipelineId() string

func (*UnsubscribeRequest) GetPipelineTriggerLabel

func (x *UnsubscribeRequest) GetPipelineTriggerLabel() string

func (*UnsubscribeRequest) ProtoMessage

func (*UnsubscribeRequest) ProtoMessage()

func (*UnsubscribeRequest) ProtoReflect

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

func (*UnsubscribeRequest) Reset

func (x *UnsubscribeRequest) Reset()

func (*UnsubscribeRequest) String

func (x *UnsubscribeRequest) String() string

type UnsubscribeResponse

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

func (*UnsubscribeResponse) Descriptor deprecated

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

Deprecated: Use UnsubscribeResponse.ProtoReflect.Descriptor instead.

func (*UnsubscribeResponse) ProtoMessage

func (*UnsubscribeResponse) ProtoMessage()

func (*UnsubscribeResponse) ProtoReflect

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

func (*UnsubscribeResponse) Reset

func (x *UnsubscribeResponse) Reset()

func (*UnsubscribeResponse) String

func (x *UnsubscribeResponse) String() string

Jump to

Keyboard shortcuts

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