internals

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// GRPCContentType is the MIME media type for grpc.
	GRPCContentType = "application/grpc"
	// JSONContentType is the MIME media type for JSON.
	JSONContentType = "application/json"
	// ProtobufContentType is the MIME media type for Protobuf.
	ProtobufContentType = "application/x-protobuf"
	// OctetStreamContentType is the MIME media type for arbitrary binary data.
	OctetStreamContentType = "application/octet-stream"
)

Variables

View Source
var (
	APIVersion_name = map[int32]string{
		0: "APIVERSION_UNSPECIFIED",
		1: "V1",
	}
	APIVersion_value = map[string]int32{
		"APIVERSION_UNSPECIFIED": 0,
		"V1":                     1,
	}
)

Enum value maps for APIVersion.

View Source
var File_dapr_proto_internals_v1_apiversion_proto protoreflect.FileDescriptor
View Source
var File_dapr_proto_internals_v1_reminders_proto protoreflect.FileDescriptor
View Source
var File_dapr_proto_internals_v1_service_invocation_proto protoreflect.FileDescriptor
View Source
var File_dapr_proto_internals_v1_status_proto protoreflect.FileDescriptor
View Source
var ServiceInvocation_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dapr.proto.internals.v1.ServiceInvocation",
	HandlerType: (*ServiceInvocationServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CallActor",
			Handler:    _ServiceInvocation_CallActor_Handler,
		},
		{
			MethodName: "CallLocal",
			Handler:    _ServiceInvocation_CallLocal_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CallLocalStream",
			Handler:       _ServiceInvocation_CallLocalStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "dapr/proto/internals/v1/service_invocation.proto",
}

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

Functions

func FastHTTPHeadersToInternalMetadata added in v1.13.0

func FastHTTPHeadersToInternalMetadata(header fasthttpHeaders) map[string]*ListStringValue

FastHTTPHeadersToInternalMetadata converts fasthttp headers to Dapr internal metadata map.

func HTTPHeadersToInternalMetadata added in v1.13.0

func HTTPHeadersToInternalMetadata(header http.Header) map[string]*ListStringValue

HTTPHeadersToInternalMetadata converts http headers to Dapr internal metadata map.

func MetadataToInternalMetadata added in v1.13.0

func MetadataToInternalMetadata(md map[string][]string) map[string]*ListStringValue

MetadataToInternalMetadata converts metadata to Dapr internal metadata map.

func RegisterServiceInvocationServer

func RegisterServiceInvocationServer(s grpc.ServiceRegistrar, srv ServiceInvocationServer)

Types

type APIVersion

type APIVersion int32

APIVersion represents the version of Dapr Runtime API.

const (
	// unspecified apiversion
	APIVersion_APIVERSION_UNSPECIFIED APIVersion = 0
	// Dapr API v1
	APIVersion_V1 APIVersion = 1
)

func (APIVersion) Descriptor added in v1.0.0

func (APIVersion) Descriptor() protoreflect.EnumDescriptor

func (APIVersion) Enum added in v1.0.0

func (x APIVersion) Enum() *APIVersion

func (APIVersion) EnumDescriptor deprecated

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

Deprecated: Use APIVersion.Descriptor instead.

func (APIVersion) Number added in v1.0.0

func (x APIVersion) Number() protoreflect.EnumNumber

func (APIVersion) String

func (x APIVersion) String() string

func (APIVersion) Type added in v1.0.0

type Actor

type Actor struct {

	// Required. The type of actor.
	ActorType string `protobuf:"bytes,1,opt,name=actor_type,json=actorType,proto3" json:"actor_type,omitempty"`
	// Required. The ID of actor type (actor_type)
	ActorId string `protobuf:"bytes,2,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"`
	// contains filtered or unexported fields
}

Actor represents actor using actor_type and actor_id

func (*Actor) Descriptor deprecated

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

Deprecated: Use Actor.ProtoReflect.Descriptor instead.

func (*Actor) GetActorId

func (x *Actor) GetActorId() string

func (*Actor) GetActorKey added in v1.13.0

func (x *Actor) GetActorKey() string

GetActorKey returns the key for the actor.

func (*Actor) GetActorType

func (x *Actor) GetActorType() string

func (*Actor) ProtoMessage

func (*Actor) ProtoMessage()

func (*Actor) ProtoReflect added in v1.0.0

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

func (*Actor) Reset

func (x *Actor) Reset()

func (*Actor) String

func (x *Actor) String() string

type InternalInvokeRequest

type InternalInvokeRequest struct {

	// Required. The version of Dapr runtime API.
	Ver APIVersion `protobuf:"varint,1,opt,name=ver,proto3,enum=dapr.proto.internals.v1.APIVersion" json:"ver,omitempty"`
	// Required. metadata holds caller's HTTP headers or gRPC metadata.
	Metadata map[string]*ListStringValue `` /* 157-byte string literal not displayed */
	// Required. message including caller's invocation request.
	Message *v1.InvokeRequest `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// Actor type and id. This field is used only for
	// actor service invocation.
	Actor *Actor `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	// contains filtered or unexported fields
}

InternalInvokeRequest is the message to transfer caller's data to callee for service invocation. This includes callee's app id and caller's request data.

func NewInternalInvokeRequest added in v1.13.0

func NewInternalInvokeRequest(method string) *InternalInvokeRequest

NewInternalInvokeRequest returns an InternalInvokeRequest with the given method

func (*InternalInvokeRequest) Descriptor deprecated

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

Deprecated: Use InternalInvokeRequest.ProtoReflect.Descriptor instead.

func (*InternalInvokeRequest) GetActor

func (x *InternalInvokeRequest) GetActor() *Actor

func (*InternalInvokeRequest) GetMessage

func (x *InternalInvokeRequest) GetMessage() *v1.InvokeRequest

func (*InternalInvokeRequest) GetMetadata

func (x *InternalInvokeRequest) GetMetadata() map[string]*ListStringValue

func (*InternalInvokeRequest) GetVer

func (x *InternalInvokeRequest) GetVer() APIVersion

func (*InternalInvokeRequest) ProtoMessage

func (*InternalInvokeRequest) ProtoMessage()

func (*InternalInvokeRequest) ProtoReflect added in v1.0.0

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

func (*InternalInvokeRequest) Reset

func (x *InternalInvokeRequest) Reset()

func (*InternalInvokeRequest) String

func (x *InternalInvokeRequest) String() string

func (*InternalInvokeRequest) WithActor added in v1.13.0

func (x *InternalInvokeRequest) WithActor(actorType, actorID string) *InternalInvokeRequest

WithActor sets actor type and id.

func (*InternalInvokeRequest) WithContentType added in v1.13.0

func (x *InternalInvokeRequest) WithContentType(contentType string) *InternalInvokeRequest

WithContentType sets the content type.

func (*InternalInvokeRequest) WithData added in v1.13.0

func (x *InternalInvokeRequest) WithData(data []byte) *InternalInvokeRequest

WithData sets the data.

func (*InternalInvokeRequest) WithDataTypeURL added in v1.13.0

func (x *InternalInvokeRequest) WithDataTypeURL(val string) *InternalInvokeRequest

WithDataTypeURL sets the type_url property for the data. When a type_url is set, the Content-Type automatically becomes the protobuf one.

func (*InternalInvokeRequest) WithFastHTTPHeaders added in v1.13.0

func (x *InternalInvokeRequest) WithFastHTTPHeaders(header fasthttpHeaders) *InternalInvokeRequest

WithFastHTTPHeaders sets metadata from fasthttp request headers.

func (*InternalInvokeRequest) WithHTTPExtension added in v1.13.0

func (x *InternalInvokeRequest) WithHTTPExtension(verb string, querystring string) *InternalInvokeRequest

WithHTTPExtension sets new HTTP extension with verb and querystring.

func (*InternalInvokeRequest) WithHTTPHeaders added in v1.13.0

func (x *InternalInvokeRequest) WithHTTPHeaders(header http.Header) *InternalInvokeRequest

WithHTTPHeaders sets metadata from HTTP request headers.

func (*InternalInvokeRequest) WithMetadata added in v1.13.0

func (x *InternalInvokeRequest) WithMetadata(md map[string][]string) *InternalInvokeRequest

WithMetadata sets metadata.

type InternalInvokeRequestStream added in v1.10.0

type InternalInvokeRequestStream struct {

	// Request details.
	// This does not contain any data in message.data.
	Request *InternalInvokeRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	// Chunk of data.
	Payload *v1.StreamPayload `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

InternalInvokeRequestStream is a variant of InternalInvokeRequest used in streaming RPCs.

func (*InternalInvokeRequestStream) Descriptor deprecated added in v1.10.0

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

Deprecated: Use InternalInvokeRequestStream.ProtoReflect.Descriptor instead.

func (*InternalInvokeRequestStream) GetPayload added in v1.10.0

func (x *InternalInvokeRequestStream) GetPayload() *v1.StreamPayload

func (*InternalInvokeRequestStream) GetRequest added in v1.10.0

func (*InternalInvokeRequestStream) ProtoMessage added in v1.10.0

func (*InternalInvokeRequestStream) ProtoMessage()

func (*InternalInvokeRequestStream) ProtoReflect added in v1.10.0

func (*InternalInvokeRequestStream) Reset added in v1.10.0

func (x *InternalInvokeRequestStream) Reset()

func (*InternalInvokeRequestStream) String added in v1.10.0

func (x *InternalInvokeRequestStream) String() string

type InternalInvokeResponse

type InternalInvokeResponse struct {

	// Required. HTTP/gRPC status.
	Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// Required. The app callback response headers.
	Headers map[string]*ListStringValue `` /* 155-byte string literal not displayed */
	// App callback response trailers.
	// This will be used only for gRPC app callback
	Trailers map[string]*ListStringValue `` /* 157-byte string literal not displayed */
	// Callee's invocation response message.
	Message *v1.InvokeResponse `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

InternalInvokeResponse is the message to transfer callee's response to caller for service invocation.

func (*InternalInvokeResponse) Descriptor deprecated

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

Deprecated: Use InternalInvokeResponse.ProtoReflect.Descriptor instead.

func (*InternalInvokeResponse) GetHeaders

func (x *InternalInvokeResponse) GetHeaders() map[string]*ListStringValue

func (*InternalInvokeResponse) GetMessage

func (x *InternalInvokeResponse) GetMessage() *v1.InvokeResponse

func (*InternalInvokeResponse) GetStatus

func (x *InternalInvokeResponse) GetStatus() *Status

func (*InternalInvokeResponse) GetTrailers

func (x *InternalInvokeResponse) GetTrailers() map[string]*ListStringValue

func (*InternalInvokeResponse) IsHTTPResponse added in v1.13.0

func (x *InternalInvokeResponse) IsHTTPResponse() bool

IsHTTPResponse returns true if response status code is http response status.

func (*InternalInvokeResponse) ProtoMessage

func (*InternalInvokeResponse) ProtoMessage()

func (*InternalInvokeResponse) ProtoReflect added in v1.0.0

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

func (*InternalInvokeResponse) Reset

func (x *InternalInvokeResponse) Reset()

func (*InternalInvokeResponse) String

func (x *InternalInvokeResponse) String() string

type InternalInvokeResponseStream added in v1.10.0

type InternalInvokeResponseStream struct {

	// Response details.
	// This does not contain any data in message.data.
	Response *InternalInvokeResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	// Chunk of data.
	Payload *v1.StreamPayload `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

InternalInvokeResponseStream is a variant of InternalInvokeResponse used in streaming RPCs.

func (*InternalInvokeResponseStream) Descriptor deprecated added in v1.10.0

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

Deprecated: Use InternalInvokeResponseStream.ProtoReflect.Descriptor instead.

func (*InternalInvokeResponseStream) GetPayload added in v1.10.0

func (*InternalInvokeResponseStream) GetResponse added in v1.10.0

func (*InternalInvokeResponseStream) ProtoMessage added in v1.10.0

func (*InternalInvokeResponseStream) ProtoMessage()

func (*InternalInvokeResponseStream) ProtoReflect added in v1.10.0

func (*InternalInvokeResponseStream) Reset added in v1.10.0

func (x *InternalInvokeResponseStream) Reset()

func (*InternalInvokeResponseStream) String added in v1.10.0

type ListStringValue

type ListStringValue struct {

	// The array of string.
	Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

ListStringValue represents string value array

func (*ListStringValue) Descriptor deprecated

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

Deprecated: Use ListStringValue.ProtoReflect.Descriptor instead.

func (*ListStringValue) GetValues

func (x *ListStringValue) GetValues() []string

func (*ListStringValue) ProtoMessage

func (*ListStringValue) ProtoMessage()

func (*ListStringValue) ProtoReflect added in v1.0.0

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

func (*ListStringValue) Reset

func (x *ListStringValue) Reset()

func (*ListStringValue) String

func (x *ListStringValue) String() string

type Reminder added in v1.13.0

type Reminder struct {
	ActorId        string                 `protobuf:"bytes,1,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"`
	ActorType      string                 `protobuf:"bytes,2,opt,name=actor_type,json=actorType,proto3" json:"actor_type,omitempty"`
	Name           string                 `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Data           []byte                 `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	Period         string                 `protobuf:"bytes,5,opt,name=period,proto3" json:"period,omitempty"`
	RegisteredTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=registered_time,json=registeredTime,proto3" json:"registered_time,omitempty"`
	DueTime        string                 `protobuf:"bytes,7,opt,name=due_time,json=dueTime,proto3" json:"due_time,omitempty"`
	ExpirationTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=expiration_time,json=expirationTime,proto3" json:"expiration_time,omitempty"`
	// contains filtered or unexported fields
}

Reminder represents a reminder that is stored in the Dapr actor state store.

func (*Reminder) Descriptor deprecated added in v1.13.0

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

Deprecated: Use Reminder.ProtoReflect.Descriptor instead.

func (*Reminder) GetActorId added in v1.13.0

func (x *Reminder) GetActorId() string

func (*Reminder) GetActorType added in v1.13.0

func (x *Reminder) GetActorType() string

func (*Reminder) GetData added in v1.13.0

func (x *Reminder) GetData() []byte

func (*Reminder) GetDueTime added in v1.13.0

func (x *Reminder) GetDueTime() string

func (*Reminder) GetExpirationTime added in v1.13.0

func (x *Reminder) GetExpirationTime() *timestamppb.Timestamp

func (*Reminder) GetName added in v1.13.0

func (x *Reminder) GetName() string

func (*Reminder) GetPeriod added in v1.13.0

func (x *Reminder) GetPeriod() string

func (*Reminder) GetRegisteredTime added in v1.13.0

func (x *Reminder) GetRegisteredTime() *timestamppb.Timestamp

func (*Reminder) ProtoMessage added in v1.13.0

func (*Reminder) ProtoMessage()

func (*Reminder) ProtoReflect added in v1.13.0

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

func (*Reminder) Reset added in v1.13.0

func (x *Reminder) Reset()

func (*Reminder) String added in v1.13.0

func (x *Reminder) String() string

type Reminders added in v1.13.0

type Reminders struct {
	Reminders []*Reminder `protobuf:"bytes,1,rep,name=reminders,proto3" json:"reminders,omitempty"`
	// contains filtered or unexported fields
}

Reminders is a collection of reminders.

func (*Reminders) Descriptor deprecated added in v1.13.0

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

Deprecated: Use Reminders.ProtoReflect.Descriptor instead.

func (*Reminders) GetReminders added in v1.13.0

func (x *Reminders) GetReminders() []*Reminder

func (*Reminders) ProtoMessage added in v1.13.0

func (*Reminders) ProtoMessage()

func (*Reminders) ProtoReflect added in v1.13.0

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

func (*Reminders) Reset added in v1.13.0

func (x *Reminders) Reset()

func (*Reminders) String added in v1.13.0

func (x *Reminders) String() string

type ServiceInvocationClient

type ServiceInvocationClient interface {
	// Invokes a method of the specific actor.
	CallActor(ctx context.Context, in *InternalInvokeRequest, opts ...grpc.CallOption) (*InternalInvokeResponse, error)
	// Invokes a method of the specific service.
	CallLocal(ctx context.Context, in *InternalInvokeRequest, opts ...grpc.CallOption) (*InternalInvokeResponse, error)
	// Invokes a method of the specific service using a stream of data.
	// Although this uses a bi-directional stream, it behaves as a "simple RPC" in which the caller sends the full request (chunked in multiple messages in the stream), then reads the full response (chunked in the stream).
	// Each message in the stream contains a `InternalInvokeRequestStream` (for caller) or `InternalInvokeResponseStream` (for callee):
	// - The first message in the stream MUST contain a `request` (caller) or `response` (callee) message with all required properties present.
	// - The first message in the stream MAY contain a `payload`, which is not required and may be empty.
	// - Subsequent messages (any message except the first one in the stream) MUST contain a `payload` and MUST NOT contain any other property (like `request` or `response`).
	// - Each message with a `payload` MUST contain a sequence number in `seq`, which is a counter that starts from 0 and MUST be incremented by 1 in each chunk. The `seq` counter MUST NOT be included if the message does not have a `payload`.
	// - When the sender has completed sending the data, it MUST call `CloseSend` on the stream.
	// The caller and callee must send at least one message in the stream. If only 1 message is sent in each direction, that message must contain both a `request`/`response` (the `payload` may be empty).
	CallLocalStream(ctx context.Context, opts ...grpc.CallOption) (ServiceInvocation_CallLocalStreamClient, error)
}

ServiceInvocationClient is the client API for ServiceInvocation 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.

type ServiceInvocationServer

type ServiceInvocationServer interface {
	// Invokes a method of the specific actor.
	CallActor(context.Context, *InternalInvokeRequest) (*InternalInvokeResponse, error)
	// Invokes a method of the specific service.
	CallLocal(context.Context, *InternalInvokeRequest) (*InternalInvokeResponse, error)
	// Invokes a method of the specific service using a stream of data.
	// Although this uses a bi-directional stream, it behaves as a "simple RPC" in which the caller sends the full request (chunked in multiple messages in the stream), then reads the full response (chunked in the stream).
	// Each message in the stream contains a `InternalInvokeRequestStream` (for caller) or `InternalInvokeResponseStream` (for callee):
	// - The first message in the stream MUST contain a `request` (caller) or `response` (callee) message with all required properties present.
	// - The first message in the stream MAY contain a `payload`, which is not required and may be empty.
	// - Subsequent messages (any message except the first one in the stream) MUST contain a `payload` and MUST NOT contain any other property (like `request` or `response`).
	// - Each message with a `payload` MUST contain a sequence number in `seq`, which is a counter that starts from 0 and MUST be incremented by 1 in each chunk. The `seq` counter MUST NOT be included if the message does not have a `payload`.
	// - When the sender has completed sending the data, it MUST call `CloseSend` on the stream.
	// The caller and callee must send at least one message in the stream. If only 1 message is sent in each direction, that message must contain both a `request`/`response` (the `payload` may be empty).
	CallLocalStream(ServiceInvocation_CallLocalStreamServer) error
}

ServiceInvocationServer is the server API for ServiceInvocation service. All implementations should embed UnimplementedServiceInvocationServer for forward compatibility

type ServiceInvocation_CallLocalStreamClient added in v1.10.0

type ServiceInvocation_CallLocalStreamClient interface {
	Send(*InternalInvokeRequestStream) error
	Recv() (*InternalInvokeResponseStream, error)
	grpc.ClientStream
}

type ServiceInvocation_CallLocalStreamServer added in v1.10.0

type ServiceInvocation_CallLocalStreamServer interface {
	Send(*InternalInvokeResponseStream) error
	Recv() (*InternalInvokeRequestStream, error)
	grpc.ServerStream
}

type Status

type Status struct {

	// Required. The status code
	Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	// Error message
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// A list of messages that carry the error details
	Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

Status represents the response status for HTTP and gRPC app channel.

func (*Status) Descriptor deprecated

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

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetCode

func (x *Status) GetCode() int32

func (*Status) GetDetails

func (x *Status) GetDetails() []*anypb.Any

func (*Status) GetMessage

func (x *Status) GetMessage() string

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect added in v1.0.0

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

func (*Status) Reset

func (x *Status) Reset()

func (*Status) String

func (x *Status) String() string

type UnimplementedServiceInvocationServer

type UnimplementedServiceInvocationServer struct {
}

UnimplementedServiceInvocationServer should be embedded to have forward compatible implementations.

func (UnimplementedServiceInvocationServer) CallActor

func (UnimplementedServiceInvocationServer) CallLocal

func (UnimplementedServiceInvocationServer) CallLocalStream added in v1.10.0

type UnsafeServiceInvocationServer added in v1.0.0

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

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

Jump to

Keyboard shortcuts

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