transportspec

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 10 Imported by: 0

README

Transport Specification

Build Status Code Coverage Latest Version Documentation Go Report Card

This repository contains gRPC service specifications for transporting Dogma messages between applications.

Documentation

Overview

Package transportspec contains gRPC service specifications for transporting Dogma messages.

Index

Constants

This section is empty.

Variables

View Source
var File_error_proto protoreflect.FileDescriptor
View Source
var File_messagetypes_proto protoreflect.FileDescriptor
View Source
var File_queue_proto protoreflect.FileDescriptor
View Source
var File_stream_proto protoreflect.FileDescriptor

Functions

func RegisterCommandQueueServer

func RegisterCommandQueueServer(s *grpc.Server, srv CommandQueueServer)

func RegisterEventStreamServer

func RegisterEventStreamServer(s *grpc.Server, srv EventStreamServer)

Types

type AckRequest

type AckRequest struct {

	// ApplicationKey is the identity key of the application that produced the
	// command.
	ApplicationKey string `protobuf:"bytes,1,opt,name=application_key,json=applicationKey,proto3" json:"application_key,omitempty"`
	// MessageID is the command message's unique identifier.
	MessageId string `protobuf:"bytes,2,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AckRequest) Descriptor deprecated

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

Deprecated: Use AckRequest.ProtoReflect.Descriptor instead.

func (*AckRequest) GetApplicationKey

func (x *AckRequest) GetApplicationKey() string

func (*AckRequest) GetMessageId

func (x *AckRequest) GetMessageId() string

func (*AckRequest) ProtoMessage

func (*AckRequest) ProtoMessage()

func (*AckRequest) ProtoReflect

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

func (*AckRequest) Reset

func (x *AckRequest) Reset()

func (*AckRequest) String

func (x *AckRequest) String() string

type AckResponse

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

func (*AckResponse) Descriptor deprecated

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

Deprecated: Use AckResponse.ProtoReflect.Descriptor instead.

func (*AckResponse) ProtoMessage

func (*AckResponse) ProtoMessage()

func (*AckResponse) ProtoReflect

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

func (*AckResponse) Reset

func (x *AckResponse) Reset()

func (*AckResponse) String

func (x *AckResponse) String() string

type CommandQueueClient

type CommandQueueClient interface {
	// Enqueue adds a message to the inbound command queue.
	//
	// The client is an engine with a message on its outbound queue. The server is
	// an engine that hosts an application that can handle commands of that type.
	//
	// If the server does not host the application specified in the request, it
	// MUST return a NOT_FOUND error with an attached UnrecognizedApplication
	// value.
	//
	// If the server does not handle messages of the type provided in the request,
	// it MUST return an INVALID_ARGUMENT error with an attached
	// UnrecognizedMessage value.
	//
	// The server MUST keep the enqueued message on its inbound queue until it
	// removes the message from the client's outbound queue by calling Ack(). The
	// mechanism for determining how to dial back to the client is engine-specific
	// and outside the scope of this specification.
	//
	// If the message in the request, identified by the message ID, is not already
	// on the queue, it is added. A successful response MUST be returned
	// regardless of whether the message was already enqueued or not.
	//
	// The client SHOULD retry the Enqueue() oepration until it receives a
	// successful response, or until it receives an Ack() call for the message.
	Enqueue(ctx context.Context, in *EnqueueRequest, opts ...grpc.CallOption) (*EnqueueResponse, error)
	// Ack removes a message from the outbound command queue.
	//
	// The client is an engine that has enqueued (and potentially already
	// executed) a message received via a prior call to Enqueue().
	//
	// If the message specified in the request is still on the outbound queue, it
	// is removed. A successful response MUST be returned regardless of whether
	// the message was still enqueued or not.
	//
	// Upon returning a successful response, the server MUST NOT make any future
	// call to Enqueue() for the specified message.
	Ack(ctx context.Context, in *AckRequest, opts ...grpc.CallOption) (*AckResponse, error)
	// MessageTypes queries the messages types that the server supports for a
	// specific application.
	//
	// If the server does not host the application specified in the request, it
	// MUST return a NOT_FOUND error with an attached UnrecognizedApplication
	// value.
	MessageTypes(ctx context.Context, in *MessageTypesRequest, opts ...grpc.CallOption) (*MessageTypesResponse, error)
}

CommandQueueClient is the client API for CommandQueue service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type CommandQueueServer

type CommandQueueServer interface {
	// Enqueue adds a message to the inbound command queue.
	//
	// The client is an engine with a message on its outbound queue. The server is
	// an engine that hosts an application that can handle commands of that type.
	//
	// If the server does not host the application specified in the request, it
	// MUST return a NOT_FOUND error with an attached UnrecognizedApplication
	// value.
	//
	// If the server does not handle messages of the type provided in the request,
	// it MUST return an INVALID_ARGUMENT error with an attached
	// UnrecognizedMessage value.
	//
	// The server MUST keep the enqueued message on its inbound queue until it
	// removes the message from the client's outbound queue by calling Ack(). The
	// mechanism for determining how to dial back to the client is engine-specific
	// and outside the scope of this specification.
	//
	// If the message in the request, identified by the message ID, is not already
	// on the queue, it is added. A successful response MUST be returned
	// regardless of whether the message was already enqueued or not.
	//
	// The client SHOULD retry the Enqueue() oepration until it receives a
	// successful response, or until it receives an Ack() call for the message.
	Enqueue(context.Context, *EnqueueRequest) (*EnqueueResponse, error)
	// Ack removes a message from the outbound command queue.
	//
	// The client is an engine that has enqueued (and potentially already
	// executed) a message received via a prior call to Enqueue().
	//
	// If the message specified in the request is still on the outbound queue, it
	// is removed. A successful response MUST be returned regardless of whether
	// the message was still enqueued or not.
	//
	// Upon returning a successful response, the server MUST NOT make any future
	// call to Enqueue() for the specified message.
	Ack(context.Context, *AckRequest) (*AckResponse, error)
	// MessageTypes queries the messages types that the server supports for a
	// specific application.
	//
	// If the server does not host the application specified in the request, it
	// MUST return a NOT_FOUND error with an attached UnrecognizedApplication
	// value.
	MessageTypes(context.Context, *MessageTypesRequest) (*MessageTypesResponse, error)
}

CommandQueueServer is the server API for CommandQueue service.

type ConsumeRequest

type ConsumeRequest struct {

	// ApplicationKey is the identity key of the application to consume from.
	ApplicationKey string `protobuf:"bytes,1,opt,name=application_key,json=applicationKey,proto3" json:"application_key,omitempty"`
	// Offset is the offset of the earliest message to be consumed.
	//
	// The offset of the message returned will be greater than this value if the
	// event at that offset is one of the requested message types.
	Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// Types is the set of message types to include in the results.
	Types []string `protobuf:"bytes,3,rep,name=types,proto3" json:"types,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumeRequest) Descriptor deprecated

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

Deprecated: Use ConsumeRequest.ProtoReflect.Descriptor instead.

func (*ConsumeRequest) GetApplicationKey

func (x *ConsumeRequest) GetApplicationKey() string

func (*ConsumeRequest) GetOffset

func (x *ConsumeRequest) GetOffset() uint64

func (*ConsumeRequest) GetTypes

func (x *ConsumeRequest) GetTypes() []string

func (*ConsumeRequest) ProtoMessage

func (*ConsumeRequest) ProtoMessage()

func (*ConsumeRequest) ProtoReflect

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

func (*ConsumeRequest) Reset

func (x *ConsumeRequest) Reset()

func (*ConsumeRequest) String

func (x *ConsumeRequest) String() string

type ConsumeResponse

type ConsumeResponse struct {

	// Offset is the offset of the message.
	//
	// It will be greater than the offset provided in the ConsumeRequest if the
	// event at the requested offset was one fo the requested message types.
	Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
	// Envelope is the envelope containing the event.
	Envelope *envelopespec.Envelope `protobuf:"bytes,2,opt,name=envelope,proto3" json:"envelope,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumeResponse) Descriptor deprecated

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

Deprecated: Use ConsumeResponse.ProtoReflect.Descriptor instead.

func (*ConsumeResponse) GetEnvelope

func (x *ConsumeResponse) GetEnvelope() *envelopespec.Envelope

func (*ConsumeResponse) GetOffset

func (x *ConsumeResponse) GetOffset() uint64

func (*ConsumeResponse) ProtoMessage

func (*ConsumeResponse) ProtoMessage()

func (*ConsumeResponse) ProtoReflect

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

func (*ConsumeResponse) Reset

func (x *ConsumeResponse) Reset()

func (*ConsumeResponse) String

func (x *ConsumeResponse) String() string

type EnqueueRequest

type EnqueueRequest struct {

	// ApplicationKey is the identity key of the application that handles the
	// command.
	ApplicationKey string `protobuf:"bytes,1,opt,name=application_key,json=applicationKey,proto3" json:"application_key,omitempty"`
	// Envelope is the envelope containing the command to be executed.
	Envelope *envelopespec.Envelope `protobuf:"bytes,2,opt,name=envelope,proto3" json:"envelope,omitempty"`
	// contains filtered or unexported fields
}

func (*EnqueueRequest) Descriptor deprecated

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

Deprecated: Use EnqueueRequest.ProtoReflect.Descriptor instead.

func (*EnqueueRequest) GetApplicationKey

func (x *EnqueueRequest) GetApplicationKey() string

func (*EnqueueRequest) GetEnvelope

func (x *EnqueueRequest) GetEnvelope() *envelopespec.Envelope

func (*EnqueueRequest) ProtoMessage

func (*EnqueueRequest) ProtoMessage()

func (*EnqueueRequest) ProtoReflect

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

func (*EnqueueRequest) Reset

func (x *EnqueueRequest) Reset()

func (*EnqueueRequest) String

func (x *EnqueueRequest) String() string

type EnqueueResponse

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

func (*EnqueueResponse) Descriptor deprecated

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

Deprecated: Use EnqueueResponse.ProtoReflect.Descriptor instead.

func (*EnqueueResponse) ProtoMessage

func (*EnqueueResponse) ProtoMessage()

func (*EnqueueResponse) ProtoReflect

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

func (*EnqueueResponse) Reset

func (x *EnqueueResponse) Reset()

func (*EnqueueResponse) String

func (x *EnqueueResponse) String() string

type EventStreamClient

type EventStreamClient interface {
	// Consume starts consuming from an application's event stream.
	//
	// If the server does not host the application specified in the request, it
	// MUST return a NOT_FOUND error with an attached UnrecognizedApplication
	// value.
	//
	// If the requested offset is beyond the end of the application's event
	// stream, the server SHOULD keep the stream open, sending the messages as
	// they become available.
	//
	// If any of the message types are not produced by the specified application
	// the server MUST return an INVALID_ARGUMENT error with an attached
	// UnrecognizedMessage value for each unrecognized message type.
	Consume(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (EventStream_ConsumeClient, error)
	// EventTypes queries the event types that the server supports for a specific
	// application.
	//
	// If the server does not host the application specified in the request, it
	// MUST return a NOT_FOUND error with an attached UnrecognizedApplication
	// value.
	EventTypes(ctx context.Context, in *MessageTypesRequest, opts ...grpc.CallOption) (*MessageTypesResponse, error)
}

EventStreamClient is the client API for EventStream service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type EventStreamServer

type EventStreamServer interface {
	// Consume starts consuming from an application's event stream.
	//
	// If the server does not host the application specified in the request, it
	// MUST return a NOT_FOUND error with an attached UnrecognizedApplication
	// value.
	//
	// If the requested offset is beyond the end of the application's event
	// stream, the server SHOULD keep the stream open, sending the messages as
	// they become available.
	//
	// If any of the message types are not produced by the specified application
	// the server MUST return an INVALID_ARGUMENT error with an attached
	// UnrecognizedMessage value for each unrecognized message type.
	Consume(*ConsumeRequest, EventStream_ConsumeServer) error
	// EventTypes queries the event types that the server supports for a specific
	// application.
	//
	// If the server does not host the application specified in the request, it
	// MUST return a NOT_FOUND error with an attached UnrecognizedApplication
	// value.
	EventTypes(context.Context, *MessageTypesRequest) (*MessageTypesResponse, error)
}

EventStreamServer is the server API for EventStream service.

type EventStream_ConsumeClient

type EventStream_ConsumeClient interface {
	Recv() (*ConsumeResponse, error)
	grpc.ClientStream
}

type EventStream_ConsumeServer

type EventStream_ConsumeServer interface {
	Send(*ConsumeResponse) error
	grpc.ServerStream
}

type MessageType

type MessageType struct {

	// PortableName is the unique name used to identify messages of this type.
	PortableName string `protobuf:"bytes,1,opt,name=portable_name,json=portableName,proto3" json:"portable_name,omitempty"`
	// ConfigName is the name used to identify this message type in the
	// dogma.config.v1 API.
	//
	// This name may differ across builds, as it is based on the fully-qualified
	// Go type name.
	ConfigName string `protobuf:"bytes,2,opt,name=config_name,json=configName,proto3" json:"config_name,omitempty"`
	// MediaTypes is a list of MIME media-types that the server may use to
	// represent messages of this type.
	MediaTypes []string `protobuf:"bytes,3,rep,name=media_types,json=mediaTypes,proto3" json:"media_types,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageType) Descriptor deprecated

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

Deprecated: Use MessageType.ProtoReflect.Descriptor instead.

func (*MessageType) GetConfigName

func (x *MessageType) GetConfigName() string

func (*MessageType) GetMediaTypes

func (x *MessageType) GetMediaTypes() []string

func (*MessageType) GetPortableName

func (x *MessageType) GetPortableName() string

func (*MessageType) ProtoMessage

func (*MessageType) ProtoMessage()

func (*MessageType) ProtoReflect

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

func (*MessageType) Reset

func (x *MessageType) Reset()

func (*MessageType) String

func (x *MessageType) String() string

type MessageTypesRequest

type MessageTypesRequest struct {

	// ApplicationKey is the identity key of the application to query.
	ApplicationKey string `protobuf:"bytes,1,opt,name=application_key,json=applicationKey,proto3" json:"application_key,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageTypesRequest) Descriptor deprecated

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

Deprecated: Use MessageTypesRequest.ProtoReflect.Descriptor instead.

func (*MessageTypesRequest) GetApplicationKey

func (x *MessageTypesRequest) GetApplicationKey() string

func (*MessageTypesRequest) ProtoMessage

func (*MessageTypesRequest) ProtoMessage()

func (*MessageTypesRequest) ProtoReflect

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

func (*MessageTypesRequest) Reset

func (x *MessageTypesRequest) Reset()

func (*MessageTypesRequest) String

func (x *MessageTypesRequest) String() string

type MessageTypesResponse

type MessageTypesResponse struct {

	// MessageTypes is the set of messages supported by the server.
	MessageTypes []*MessageType `protobuf:"bytes,1,rep,name=message_types,json=messageTypes,proto3" json:"message_types,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageTypesResponse) Descriptor deprecated

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

Deprecated: Use MessageTypesResponse.ProtoReflect.Descriptor instead.

func (*MessageTypesResponse) GetMessageTypes

func (x *MessageTypesResponse) GetMessageTypes() []*MessageType

func (*MessageTypesResponse) ProtoMessage

func (*MessageTypesResponse) ProtoMessage()

func (*MessageTypesResponse) ProtoReflect

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

func (*MessageTypesResponse) Reset

func (x *MessageTypesResponse) Reset()

func (*MessageTypesResponse) String

func (x *MessageTypesResponse) String() string

type UnimplementedCommandQueueServer

type UnimplementedCommandQueueServer struct {
}

UnimplementedCommandQueueServer can be embedded to have forward compatible implementations.

func (*UnimplementedCommandQueueServer) Ack

func (*UnimplementedCommandQueueServer) Enqueue

func (*UnimplementedCommandQueueServer) MessageTypes

type UnimplementedEventStreamServer

type UnimplementedEventStreamServer struct {
}

UnimplementedEventStreamServer can be embedded to have forward compatible implementations.

func (*UnimplementedEventStreamServer) Consume

func (*UnimplementedEventStreamServer) EventTypes

type UnrecognizedApplication

type UnrecognizedApplication struct {

	// ApplicationKey is the identity of the application that produced the error.
	ApplicationKey string `protobuf:"bytes,1,opt,name=application_key,json=applicationKey,proto3" json:"application_key,omitempty"`
	// contains filtered or unexported fields
}

UnrecognizedApplication is an error-details value for INVALID_ARGUMENT errors that occurred because a specific application key was not recognized by the server.

func (*UnrecognizedApplication) Descriptor deprecated

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

Deprecated: Use UnrecognizedApplication.ProtoReflect.Descriptor instead.

func (*UnrecognizedApplication) GetApplicationKey

func (x *UnrecognizedApplication) GetApplicationKey() string

func (*UnrecognizedApplication) ProtoMessage

func (*UnrecognizedApplication) ProtoMessage()

func (*UnrecognizedApplication) ProtoReflect

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

func (*UnrecognizedApplication) Reset

func (x *UnrecognizedApplication) Reset()

func (*UnrecognizedApplication) String

func (x *UnrecognizedApplication) String() string

type UnrecognizedMessage

type UnrecognizedMessage struct {

	// Name is the name of the message type.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

UnrecognizedMessage is an error-details value for INVALID_ARGUMENT errors that occurred because a specific message type was not recognized by the server.

func (*UnrecognizedMessage) Descriptor deprecated

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

Deprecated: Use UnrecognizedMessage.ProtoReflect.Descriptor instead.

func (*UnrecognizedMessage) GetName

func (x *UnrecognizedMessage) GetName() string

func (*UnrecognizedMessage) ProtoMessage

func (*UnrecognizedMessage) ProtoMessage()

func (*UnrecognizedMessage) ProtoReflect

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

func (*UnrecognizedMessage) Reset

func (x *UnrecognizedMessage) Reset()

func (*UnrecognizedMessage) String

func (x *UnrecognizedMessage) String() string

Jump to

Keyboard shortcuts

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