sdkv1

package
v1.32.0-20240227184845... Latest Latest
Warning

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

Go to latest
Published: unknown License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0:  "STATUS_UNSPECIFIED",
		1:  "STATUS_OK",
		2:  "STATUS_TIMEOUT",
		3:  "STATUS_THROTTLED",
		4:  "STATUS_INVALID_ARGUMENT",
		5:  "STATUS_INVALID_RESPONSE",
		6:  "STATUS_TEMPORARY_ERROR",
		7:  "STATUS_PERMANENT_ERROR",
		8:  "STATUS_INCOMPATIBLE_STATE",
		9:  "STATUS_DNS_ERROR",
		10: "STATUS_TCP_ERROR",
		11: "STATUS_TLS_ERROR",
		12: "STATUS_HTTP_ERROR",
		13: "STATUS_UNAUTHENTICATED",
		14: "STATUS_PERMISSION_DENIED",
		15: "STATUS_NOT_FOUND",
	}
	Status_value = map[string]int32{
		"STATUS_UNSPECIFIED":        0,
		"STATUS_OK":                 1,
		"STATUS_TIMEOUT":            2,
		"STATUS_THROTTLED":          3,
		"STATUS_INVALID_ARGUMENT":   4,
		"STATUS_INVALID_RESPONSE":   5,
		"STATUS_TEMPORARY_ERROR":    6,
		"STATUS_PERMANENT_ERROR":    7,
		"STATUS_INCOMPATIBLE_STATE": 8,
		"STATUS_DNS_ERROR":          9,
		"STATUS_TCP_ERROR":          10,
		"STATUS_TLS_ERROR":          11,
		"STATUS_HTTP_ERROR":         12,
		"STATUS_UNAUTHENTICATED":    13,
		"STATUS_PERMISSION_DENIED":  14,
		"STATUS_NOT_FOUND":          15,
	}
)

Enum value maps for Status.

View Source
var File_dispatch_sdk_v1_call_proto protoreflect.FileDescriptor
View Source
var File_dispatch_sdk_v1_dispatch_proto protoreflect.FileDescriptor
View Source
var File_dispatch_sdk_v1_error_proto protoreflect.FileDescriptor
View Source
var File_dispatch_sdk_v1_exit_proto protoreflect.FileDescriptor
View Source
var File_dispatch_sdk_v1_function_proto protoreflect.FileDescriptor
View Source
var File_dispatch_sdk_v1_poll_proto protoreflect.FileDescriptor
View Source
var File_dispatch_sdk_v1_status_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Call

type Call struct {

	// Correlation ID is an opaque value that gets repeated in CallResult to
	// correlate asynchronous calls with their results.
	//
	// This field is ignored when used in a dispatch request.
	CorrelationId uint64 `protobuf:"varint,1,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"`
	// Endpoint is an identifier of the location where the service hosting the
	// function can be reached.
	//
	// This field might be omitted when the endpoint is known. For example, when
	// a submitting a call to a function in the same service, the endpoint is
	// assumed to be the same as the current service.
	Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	// Identifier of the function to call. This value is sent in the run request
	// received by the function service when the asynchronous call is made.
	Function string `protobuf:"bytes,3,opt,name=function,proto3" json:"function,omitempty"`
	// Arguments to the coroutine.
	Input *anypb.Any `protobuf:"bytes,4,opt,name=input,proto3" json:"input,omitempty"`
	// Expiration is the maximum time the function is allowed to run. If the
	// function does not complete within this time, the call is considered
	// failed and the result will contain an error.
	//
	// The value might be capped to a maximum by the service handling the call.
	Expiration *durationpb.Duration `protobuf:"bytes,5,opt,name=expiration,proto3" json:"expiration,omitempty"`
	// contains filtered or unexported fields
}

Call is a directive for asynchronous function invocation.

func (*Call) Descriptor deprecated

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

Deprecated: Use Call.ProtoReflect.Descriptor instead.

func (*Call) GetCorrelationId

func (x *Call) GetCorrelationId() uint64

func (*Call) GetEndpoint

func (x *Call) GetEndpoint() string

func (*Call) GetExpiration

func (x *Call) GetExpiration() *durationpb.Duration

func (*Call) GetFunction

func (x *Call) GetFunction() string

func (*Call) GetInput

func (x *Call) GetInput() *anypb.Any

func (*Call) ProtoMessage

func (*Call) ProtoMessage()

func (*Call) ProtoReflect

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

func (*Call) Reset

func (x *Call) Reset()

func (*Call) String

func (x *Call) String() string

type CallResult

type CallResult struct {

	// Correlation ID is the value that was originally passed in the Call message.
	// This field is intended to be used by the function to correlate the result
	// with the original call.
	CorrelationId uint64 `protobuf:"varint,1,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"`
	// The result of the call.
	Output *anypb.Any `protobuf:"bytes,2,opt,name=output,proto3" json:"output,omitempty"`
	// If the field is set, it contains a representation of any error that
	// prevented the call from completing successfully.
	//
	// It is valid to have both an output and an error, in which case the output
	// might contain a partial result.
	Error *Error `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

CallResult is the result of a call operation.

func (*CallResult) Descriptor deprecated

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

Deprecated: Use CallResult.ProtoReflect.Descriptor instead.

func (*CallResult) GetCorrelationId

func (x *CallResult) GetCorrelationId() uint64

func (*CallResult) GetError

func (x *CallResult) GetError() *Error

func (*CallResult) GetOutput

func (x *CallResult) GetOutput() *anypb.Any

func (*CallResult) ProtoMessage

func (*CallResult) ProtoMessage()

func (*CallResult) ProtoReflect

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

func (*CallResult) Reset

func (x *CallResult) Reset()

func (*CallResult) String

func (x *CallResult) String() string

type DispatchRequest

type DispatchRequest struct {

	// List of calls to dispatch.
	//
	// The calls must have a non-empty endpoint which are valid http or https URLs.
	//
	// The correlation ids are ignored in this context.
	Calls []*Call `protobuf:"bytes,1,rep,name=calls,proto3" json:"calls,omitempty"`
	// contains filtered or unexported fields
}

DispatchRequest is received by calls to the Dispatch method of DispatchService.

func (*DispatchRequest) Descriptor deprecated

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

Deprecated: Use DispatchRequest.ProtoReflect.Descriptor instead.

func (*DispatchRequest) GetCalls

func (x *DispatchRequest) GetCalls() []*Call

func (*DispatchRequest) ProtoMessage

func (*DispatchRequest) ProtoMessage()

func (*DispatchRequest) ProtoReflect

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

func (*DispatchRequest) Reset

func (x *DispatchRequest) Reset()

func (*DispatchRequest) String

func (x *DispatchRequest) String() string

type DispatchResponse

type DispatchResponse struct {

	// List of opque identifiers representing the dispatched calls from the
	// corresponding request.
	//
	// The identifiers are given in the same order as the calls in the request,
	// allowing the client to correlate them by index.
	DispatchIds []string `protobuf:"bytes,1,rep,name=dispatch_ids,json=dispatchIds,proto3" json:"dispatch_ids,omitempty"`
	// contains filtered or unexported fields
}

DispatchResponse is returned by calls to the Dispatch method of DispatchService.

func (*DispatchResponse) Descriptor deprecated

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

Deprecated: Use DispatchResponse.ProtoReflect.Descriptor instead.

func (*DispatchResponse) GetDispatchIds

func (x *DispatchResponse) GetDispatchIds() []string

func (*DispatchResponse) ProtoMessage

func (*DispatchResponse) ProtoMessage()

func (*DispatchResponse) ProtoReflect

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

func (*DispatchResponse) Reset

func (x *DispatchResponse) Reset()

func (*DispatchResponse) String

func (x *DispatchResponse) String() string

type Error

type Error struct {

	// The type of error that occurred.
	//
	// This value is language and application specific. It is is used to provide
	// debugging information to the user.
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// A human-readable message providing more details about the error.
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// A language-specific representation of the error.
	//
	// This field is used to enable propagation of the error value between
	// instances of a program, by encoding information allowing the error value
	// to be reconstructed.
	Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// The encoded stack trace for the error.
	//
	// The format is language-specific, encoded in the standard format used by
	// each programming language to represent stack traces. Not all languages have
	// stack traces for errors, so in some cases the value might be omitted.
	Traceback []byte `protobuf:"bytes,4,opt,name=traceback,proto3" json:"traceback,omitempty"`
	// contains filtered or unexported fields
}

Error represents a failure to execute a request. The type and message are arbitrary and depend on the application that handled the execution.

Categorization of success and failure conditions is done via the status field in the ExecuteResponse message.

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) GetTraceback

func (x *Error) GetTraceback() []byte

func (*Error) GetType

func (x *Error) GetType() string

func (*Error) GetValue

func (x *Error) GetValue() []byte

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type Exit

type Exit struct {

	// Result of the function run.
	Result *CallResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// Optional tail call to trigger another function call.
	//
	// Tail calls are useful to replace the current function run with a different
	// piece of code, and potentially with a different input.
	TailCall *Call `protobuf:"bytes,2,opt,name=tail_call,json=tailCall,proto3" json:"tail_call,omitempty"`
	// contains filtered or unexported fields
}

Exit is the directive used by functions to instruct the caller that the execution has completed.

func (*Exit) Descriptor deprecated

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

Deprecated: Use Exit.ProtoReflect.Descriptor instead.

func (*Exit) GetResult

func (x *Exit) GetResult() *CallResult

func (*Exit) GetTailCall

func (x *Exit) GetTailCall() *Call

func (*Exit) ProtoMessage

func (*Exit) ProtoMessage()

func (*Exit) ProtoReflect

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

func (*Exit) Reset

func (x *Exit) Reset()

func (*Exit) String

func (x *Exit) String() string

type Poll

type Poll struct {

	// Snapshot of the coroutine state that will be used in the next run to
	// resume the function.
	CoroutineState []byte `protobuf:"bytes,1,opt,name=coroutine_state,json=coroutineState,proto3" json:"coroutine_state,omitempty"`
	// Calls to make asynchronously.
	Calls []*Call `protobuf:"bytes,2,rep,name=calls,proto3" json:"calls,omitempty"`
	// Max wait is the maximum amount of time the task should be suspended for
	// while waiting for call results.
	MaxWait *durationpb.Duration `protobuf:"bytes,3,opt,name=max_wait,json=maxWait,proto3" json:"max_wait,omitempty"`
	// Max results is the maximum number of call results to deliver in the
	// poll response.
	MaxResults int32 `protobuf:"varint,4,opt,name=max_results,json=maxResults,proto3" json:"max_results,omitempty"`
	// Min results is the minimum number of call results to wait for before the
	// task is resumed. The coroutine will be suspended until either min_results
	// are available, or the max_wait timeout is reached, whichever comes first.
	MinResults int32 `protobuf:"varint,5,opt,name=min_results,json=minResults,proto3" json:"min_results,omitempty"`
	// contains filtered or unexported fields
}

Poll is a directive to make asynchronous calls and join on their results.

func (*Poll) Descriptor deprecated

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

Deprecated: Use Poll.ProtoReflect.Descriptor instead.

func (*Poll) GetCalls

func (x *Poll) GetCalls() []*Call

func (*Poll) GetCoroutineState

func (x *Poll) GetCoroutineState() []byte

func (*Poll) GetMaxResults

func (x *Poll) GetMaxResults() int32

func (*Poll) GetMaxWait

func (x *Poll) GetMaxWait() *durationpb.Duration

func (*Poll) GetMinResults

func (x *Poll) GetMinResults() int32

func (*Poll) ProtoMessage

func (*Poll) ProtoMessage()

func (*Poll) ProtoReflect

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

func (*Poll) Reset

func (x *Poll) Reset()

func (*Poll) String

func (x *Poll) String() string

type PollResult

type PollResult struct {

	// The coroutine state that was recorded by the coroutine when it was last
	// paused.
	CoroutineState []byte `protobuf:"bytes,1,opt,name=coroutine_state,json=coroutineState,proto3" json:"coroutine_state,omitempty"`
	// The list of results from calls that were made by the coroutine and
	// completed during the poll.
	Results []*CallResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"`
	// Error that occured processing a Poll directive. An error indicates
	// that none of the calls were dispatched, and must be resubmitted
	// after the error cause has been resolved.
	Error *Error `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

PollResult is the response to a Poll directive.

func (*PollResult) Descriptor deprecated

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

Deprecated: Use PollResult.ProtoReflect.Descriptor instead.

func (*PollResult) GetCoroutineState

func (x *PollResult) GetCoroutineState() []byte

func (*PollResult) GetError

func (x *PollResult) GetError() *Error

func (*PollResult) GetResults

func (x *PollResult) GetResults() []*CallResult

func (*PollResult) ProtoMessage

func (*PollResult) ProtoMessage()

func (*PollResult) ProtoReflect

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

func (*PollResult) Reset

func (x *PollResult) Reset()

func (*PollResult) String

func (x *PollResult) String() string

type RunRequest

type RunRequest struct {

	// Identifier of the function to run.
	//
	// This value corresponds to the function name that was originally submitted
	// by the dispatch request.
	Function string `protobuf:"bytes,1,opt,name=function,proto3" json:"function,omitempty"`
	// The function run is associated a directive that defines whether the run
	// is a new invocation of the function, or a continuation of a suspended
	// coroutine.
	//
	// Types that are assignable to Directive:
	//
	//	*RunRequest_Input
	//	*RunRequest_PollResult
	Directive isRunRequest_Directive `protobuf_oneof:"directive"`
	// contains filtered or unexported fields
}

RunRequest is received by calls to the Run method of FunctionService.

func (*RunRequest) Descriptor deprecated

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

Deprecated: Use RunRequest.ProtoReflect.Descriptor instead.

func (*RunRequest) GetDirective

func (m *RunRequest) GetDirective() isRunRequest_Directive

func (*RunRequest) GetFunction

func (x *RunRequest) GetFunction() string

func (*RunRequest) GetInput

func (x *RunRequest) GetInput() *anypb.Any

func (*RunRequest) GetPollResult

func (x *RunRequest) GetPollResult() *PollResult

func (*RunRequest) ProtoMessage

func (*RunRequest) ProtoMessage()

func (*RunRequest) ProtoReflect

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

func (*RunRequest) Reset

func (x *RunRequest) Reset()

func (*RunRequest) String

func (x *RunRequest) String() string

type RunRequest_Input

type RunRequest_Input struct {
	// On the first run of a function, the input field contains the parameters
	// to pass to the function.
	//
	// This is the same value that was originally passed in the dispatch request
	// that triggered the function to run.
	Input *anypb.Any `protobuf:"bytes,2,opt,name=input,proto3,oneof"`
}

type RunRequest_PollResult

type RunRequest_PollResult struct {
	// PollResult represents the result of a poll operation. When a previous
	// function run was suspended by returning a poll directive to the caller,
	// the following run of the function resumes execution and provides the
	// set of results for operations that have completed.
	PollResult *PollResult `protobuf:"bytes,3,opt,name=poll_result,json=pollResult,proto3,oneof"`
}

type RunResponse

type RunResponse struct {

	// Status defines the status of the function run. This field is used by the
	// caller to categorize the condition under which the function run returned.
	Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=dispatch.sdk.v1.Status" json:"status,omitempty"`
	// The function run instructs the caller of what it expects to happen next by
	// embedding a directive in the response.
	//
	// Types that are assignable to Directive:
	//
	//	*RunResponse_Exit
	//	*RunResponse_Poll
	Directive isRunResponse_Directive `protobuf_oneof:"directive"`
	// contains filtered or unexported fields
}

RunResponse is returned by calls to the Run method of FunctionService.

func (*RunResponse) Descriptor deprecated

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

Deprecated: Use RunResponse.ProtoReflect.Descriptor instead.

func (*RunResponse) GetDirective

func (m *RunResponse) GetDirective() isRunResponse_Directive

func (*RunResponse) GetExit

func (x *RunResponse) GetExit() *Exit

func (*RunResponse) GetPoll

func (x *RunResponse) GetPoll() *Poll

func (*RunResponse) GetStatus

func (x *RunResponse) GetStatus() Status

func (*RunResponse) ProtoMessage

func (*RunResponse) ProtoMessage()

func (*RunResponse) ProtoReflect

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

func (*RunResponse) Reset

func (x *RunResponse) Reset()

func (*RunResponse) String

func (x *RunResponse) String() string

type RunResponse_Exit

type RunResponse_Exit struct {
	// When the function run completes, an exit directive is returned to the
	// caller. The exit directive contains the result of the function run, along
	// with an optional tail call to trigger the run of another function.
	Exit *Exit `protobuf:"bytes,2,opt,name=exit,proto3,oneof"`
}

type RunResponse_Poll

type RunResponse_Poll struct {
	// When the function run is suspended, a poll directive is returned to the
	// caller. The poll directive contains the state of the coroutine, and a set
	// of calls to make asynchronously. The caller is expected to wait for the
	// results of the calls, and then resume the function run by providing the
	// results in a subsequent RunRequest.
	Poll *Poll `protobuf:"bytes,3,opt,name=poll,proto3,oneof"`
}

type Status

type Status int32

The Status enumeration is used to categorize the success or failure conditions resulting from an execution request.

const (
	Status_STATUS_UNSPECIFIED        Status = 0
	Status_STATUS_OK                 Status = 1
	Status_STATUS_TIMEOUT            Status = 2
	Status_STATUS_THROTTLED          Status = 3
	Status_STATUS_INVALID_ARGUMENT   Status = 4
	Status_STATUS_INVALID_RESPONSE   Status = 5
	Status_STATUS_TEMPORARY_ERROR    Status = 6
	Status_STATUS_PERMANENT_ERROR    Status = 7
	Status_STATUS_INCOMPATIBLE_STATE Status = 8
	Status_STATUS_DNS_ERROR          Status = 9
	Status_STATUS_TCP_ERROR          Status = 10
	Status_STATUS_TLS_ERROR          Status = 11
	Status_STATUS_HTTP_ERROR         Status = 12
	Status_STATUS_UNAUTHENTICATED    Status = 13
	Status_STATUS_PERMISSION_DENIED  Status = 14
	Status_STATUS_NOT_FOUND          Status = 15
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

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

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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