configpb

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MessageKind_name = map[int32]string{
		0: "UNKNOWN_MESSAGE_KIND",
		1: "COMMAND",
		2: "EVENT",
		3: "TIMEOUT",
	}
	MessageKind_value = map[string]int32{
		"UNKNOWN_MESSAGE_KIND": 0,
		"COMMAND":              1,
		"EVENT":                2,
		"TIMEOUT":              3,
	}
)

Enum value maps for MessageKind.

View Source
var (
	HandlerType_name = map[int32]string{
		0: "UNKNOWN_HANDLER_TYPE",
		1: "AGGREGATE",
		2: "PROCESS",
		3: "INTEGRATION",
		4: "PROJECTION",
	}
	HandlerType_value = map[string]int32{
		"UNKNOWN_HANDLER_TYPE": 0,
		"AGGREGATE":            1,
		"PROCESS":              2,
		"INTEGRATION":          3,
		"PROJECTION":           4,
	}
)

Enum value maps for HandlerType.

View Source
var File_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto protoreflect.FileDescriptor

Functions

func Map_HandlerType

func Map_HandlerType[T any](
	v HandlerType,
	caseUNKNOWN_HANDLER_TYPE func(HandlerType_UNKNOWN_HANDLER_TYPE_Case) T,
	caseAGGREGATE func(HandlerType_AGGREGATE_Case) T,
	casePROCESS func(HandlerType_PROCESS_Case) T,
	caseINTEGRATION func(HandlerType_INTEGRATION_Case) T,
	casePROJECTION func(HandlerType_PROJECTION_Case) T,
) T

Map_HandlerType maps a member of the HandlerType enumeration to a value of type T.

It invokes the function that corresponds to v, and returns that function's result. It panics if v is not a recognized HandlerType value.

func Map_MessageKind

func Map_MessageKind[T any](
	v MessageKind,
	caseUNKNOWN_MESSAGE_KIND func(MessageKind_UNKNOWN_MESSAGE_KIND_Case) T,
	caseCOMMAND func(MessageKind_COMMAND_Case) T,
	caseEVENT func(MessageKind_EVENT_Case) T,
	caseTIMEOUT func(MessageKind_TIMEOUT_Case) T,
) T

Map_MessageKind maps a member of the MessageKind enumeration to a value of type T.

It invokes the function that corresponds to v, and returns that function's result. It panics if v is not a recognized MessageKind value.

func Switch_HandlerType

func Switch_HandlerType(
	v HandlerType,
	caseUNKNOWN_HANDLER_TYPE func(HandlerType_UNKNOWN_HANDLER_TYPE_Case),
	caseAGGREGATE func(HandlerType_AGGREGATE_Case),
	casePROCESS func(HandlerType_PROCESS_Case),
	caseINTEGRATION func(HandlerType_INTEGRATION_Case),
	casePROJECTION func(HandlerType_PROJECTION_Case),
)

Switch_HandlerType dispatches to a function based on the value of v.

It invokes the function that corresponds to v. It panics if v is not a recognized HandlerType value.

func Switch_MessageKind

func Switch_MessageKind(
	v MessageKind,
	caseUNKNOWN_MESSAGE_KIND func(MessageKind_UNKNOWN_MESSAGE_KIND_Case),
	caseCOMMAND func(MessageKind_COMMAND_Case),
	caseEVENT func(MessageKind_EVENT_Case),
	caseTIMEOUT func(MessageKind_TIMEOUT_Case),
)

Switch_MessageKind dispatches to a function based on the value of v.

It invokes the function that corresponds to v. It panics if v is not a recognized MessageKind value.

Types

type Application

type Application struct {

	// Identity is the application's identity.
	Identity *identitypb.Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
	// GoType is the fully-qualified name of the Go type that provides as the
	// application's implementation.
	GoType string `protobuf:"bytes,2,opt,name=go_type,json=goType,proto3" json:"go_type,omitempty"`
	// Handlers is the set of handlers within the application.
	Handlers []*Handler `protobuf:"bytes,3,rep,name=handlers,proto3" json:"handlers,omitempty"`
	// MessageKinds is a map of each message type's fully-qualified Go type to its
	// the kind of message it implemented by that type.
	Messages map[string]MessageKind `` /* 190-byte string literal not displayed */
	// contains filtered or unexported fields
}

Application represents a Dogma application hosted by the engine on the server.

func (*Application) Descriptor deprecated

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

Deprecated: Use Application.ProtoReflect.Descriptor instead.

func (*Application) GetGoType

func (x *Application) GetGoType() string

func (*Application) GetHandlers

func (x *Application) GetHandlers() []*Handler

func (*Application) GetIdentity

func (x *Application) GetIdentity() *identitypb.Identity

func (*Application) GetMessages added in v0.16.0

func (x *Application) GetMessages() map[string]MessageKind

func (*Application) ProtoMessage

func (*Application) ProtoMessage()

func (*Application) ProtoReflect

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

func (*Application) Reset

func (x *Application) Reset()

func (*Application) SetGoType

func (x *Application) SetGoType(v string)

SetGoType sets the x.GoType field to v, then returns x.

func (*Application) SetHandlers

func (x *Application) SetHandlers(v []*Handler)

SetHandlers sets the x.Handlers field to v, then returns x.

func (*Application) SetIdentity

func (x *Application) SetIdentity(v *identitypb.Identity)

SetIdentity sets the x.Identity field to v, then returns x.

func (*Application) SetMessages added in v0.16.0

func (x *Application) SetMessages(v map[string]MessageKind)

SetMessages sets the x.Messages field to v, then returns x.

func (*Application) String

func (x *Application) String() string

type ApplicationBuilder

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

func NewApplicationBuilder

func NewApplicationBuilder() *ApplicationBuilder

NewApplicationBuilder returns a builder that constructs Application messages.

func (*ApplicationBuilder) Build

func (b *ApplicationBuilder) Build() *Application

Build returns a new Application containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*ApplicationBuilder) From

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*ApplicationBuilder) WithGoType

func (b *ApplicationBuilder) WithGoType(v string) *ApplicationBuilder

WithGoType configures the builder to set the GoType field to v, then returns b.

func (*ApplicationBuilder) WithHandlers

func (b *ApplicationBuilder) WithHandlers(v []*Handler) *ApplicationBuilder

WithHandlers configures the builder to set the Handlers field to v, then returns b.

func (*ApplicationBuilder) WithIdentity

WithIdentity configures the builder to set the Identity field to v, then returns b.

func (*ApplicationBuilder) WithMessages added in v0.16.0

func (b *ApplicationBuilder) WithMessages(v map[string]MessageKind) *ApplicationBuilder

WithMessages configures the builder to set the Messages field to v, then returns b.

type Handler

type Handler struct {

	// Identity is the handler's identity.
	Identity *identitypb.Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
	// GoType is the fully-qualified name of the Go type that provides as the
	// handler's implementation.
	GoType string `protobuf:"bytes,2,opt,name=go_type,json=goType,proto3" json:"go_type,omitempty"`
	// Type is the handler's type.
	Type HandlerType `protobuf:"varint,3,opt,name=type,proto3,enum=dogma.protobuf.HandlerType" json:"type,omitempty"`
	// messages is the set of messages produced and consumed by this handler.
	//
	// The keys are the fully-qualified names of the message's Go type.
	Messages map[string]*MessageUsage `` /* 157-byte string literal not displayed */
	// IsDisabled indicates whether the handler is disabled.
	IsDisabled bool `protobuf:"varint,5,opt,name=is_disabled,json=isDisabled,proto3" json:"is_disabled,omitempty"`
	// contains filtered or unexported fields
}

Handler is a message handler within an application.

func (*Handler) Descriptor deprecated

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

Deprecated: Use Handler.ProtoReflect.Descriptor instead.

func (*Handler) GetGoType

func (x *Handler) GetGoType() string

func (*Handler) GetIdentity

func (x *Handler) GetIdentity() *identitypb.Identity

func (*Handler) GetIsDisabled

func (x *Handler) GetIsDisabled() bool

func (*Handler) GetMessages added in v0.16.0

func (x *Handler) GetMessages() map[string]*MessageUsage

func (*Handler) GetType

func (x *Handler) GetType() HandlerType

func (*Handler) ProtoMessage

func (*Handler) ProtoMessage()

func (*Handler) ProtoReflect

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

func (*Handler) Reset

func (x *Handler) Reset()

func (*Handler) SetGoType

func (x *Handler) SetGoType(v string)

SetGoType sets the x.GoType field to v, then returns x.

func (*Handler) SetIdentity

func (x *Handler) SetIdentity(v *identitypb.Identity)

SetIdentity sets the x.Identity field to v, then returns x.

func (*Handler) SetIsDisabled

func (x *Handler) SetIsDisabled(v bool)

SetIsDisabled sets the x.IsDisabled field to v, then returns x.

func (*Handler) SetMessages added in v0.16.0

func (x *Handler) SetMessages(v map[string]*MessageUsage)

SetMessages sets the x.Messages field to v, then returns x.

func (*Handler) SetType

func (x *Handler) SetType(v HandlerType)

SetType sets the x.Type field to v, then returns x.

func (*Handler) String

func (x *Handler) String() string

type HandlerBuilder

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

func NewHandlerBuilder

func NewHandlerBuilder() *HandlerBuilder

NewHandlerBuilder returns a builder that constructs Handler messages.

func (*HandlerBuilder) Build

func (b *HandlerBuilder) Build() *Handler

Build returns a new Handler containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*HandlerBuilder) From

func (b *HandlerBuilder) From(x *Handler) *HandlerBuilder

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*HandlerBuilder) WithGoType

func (b *HandlerBuilder) WithGoType(v string) *HandlerBuilder

WithGoType configures the builder to set the GoType field to v, then returns b.

func (*HandlerBuilder) WithIdentity

func (b *HandlerBuilder) WithIdentity(v *identitypb.Identity) *HandlerBuilder

WithIdentity configures the builder to set the Identity field to v, then returns b.

func (*HandlerBuilder) WithIsDisabled

func (b *HandlerBuilder) WithIsDisabled(v bool) *HandlerBuilder

WithIsDisabled configures the builder to set the IsDisabled field to v, then returns b.

func (*HandlerBuilder) WithMessages added in v0.16.0

func (b *HandlerBuilder) WithMessages(v map[string]*MessageUsage) *HandlerBuilder

WithMessages configures the builder to set the Messages field to v, then returns b.

func (*HandlerBuilder) WithType

func (b *HandlerBuilder) WithType(v HandlerType) *HandlerBuilder

WithType configures the builder to set the Type field to v, then returns b.

type HandlerType

type HandlerType int32

HandlerType is an enumeration of the types of handlers that an application can contain.

const (
	HandlerType_UNKNOWN_HANDLER_TYPE HandlerType = 0
	HandlerType_AGGREGATE            HandlerType = 1
	HandlerType_PROCESS              HandlerType = 2
	HandlerType_INTEGRATION          HandlerType = 3
	HandlerType_PROJECTION           HandlerType = 4
)

func (HandlerType) Descriptor

func (HandlerType) Enum

func (x HandlerType) Enum() *HandlerType

func (HandlerType) EnumDescriptor deprecated

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

Deprecated: Use HandlerType.Descriptor instead.

func (HandlerType) Number

func (x HandlerType) Number() protoreflect.EnumNumber

func (HandlerType) String

func (x HandlerType) String() string

func (HandlerType) Type

type HandlerType_AGGREGATE_Case

type HandlerType_AGGREGATE_Case struct{}

HandlerType_AGGREGATE_Case is a type that statically associates a function with a HandlerType_AGGREGATE value.

type HandlerType_INTEGRATION_Case

type HandlerType_INTEGRATION_Case struct{}

HandlerType_INTEGRATION_Case is a type that statically associates a function with a HandlerType_INTEGRATION value.

type HandlerType_PROCESS_Case

type HandlerType_PROCESS_Case struct{}

HandlerType_PROCESS_Case is a type that statically associates a function with a HandlerType_PROCESS value.

type HandlerType_PROJECTION_Case

type HandlerType_PROJECTION_Case struct{}

HandlerType_PROJECTION_Case is a type that statically associates a function with a HandlerType_PROJECTION value.

type HandlerType_UNKNOWN_HANDLER_TYPE_Case

type HandlerType_UNKNOWN_HANDLER_TYPE_Case struct{}

HandlerType_UNKNOWN_HANDLER_TYPE_Case is a type that statically associates a function with a HandlerType_UNKNOWN_HANDLER_TYPE value.

type MessageKind

type MessageKind int32

MessageKind is an enumeration of the kinds of message, represented by the [dogma.Command], [dogma.Event], and [dogma.Timeout] interfaces.

const (
	MessageKind_UNKNOWN_MESSAGE_KIND MessageKind = 0
	MessageKind_COMMAND              MessageKind = 1
	MessageKind_EVENT                MessageKind = 2
	MessageKind_TIMEOUT              MessageKind = 3
)

func (MessageKind) Descriptor

func (MessageKind) Enum

func (x MessageKind) Enum() *MessageKind

func (MessageKind) EnumDescriptor deprecated

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

Deprecated: Use MessageKind.Descriptor instead.

func (MessageKind) Number

func (x MessageKind) Number() protoreflect.EnumNumber

func (MessageKind) String

func (x MessageKind) String() string

func (MessageKind) Type

type MessageKind_COMMAND_Case

type MessageKind_COMMAND_Case struct{}

MessageKind_COMMAND_Case is a type that statically associates a function with a MessageKind_COMMAND value.

type MessageKind_EVENT_Case

type MessageKind_EVENT_Case struct{}

MessageKind_EVENT_Case is a type that statically associates a function with a MessageKind_EVENT value.

type MessageKind_TIMEOUT_Case

type MessageKind_TIMEOUT_Case struct{}

MessageKind_TIMEOUT_Case is a type that statically associates a function with a MessageKind_TIMEOUT value.

type MessageKind_UNKNOWN_MESSAGE_KIND_Case

type MessageKind_UNKNOWN_MESSAGE_KIND_Case struct{}

MessageKind_UNKNOWN_MESSAGE_KIND_Case is a type that statically associates a function with a MessageKind_UNKNOWN_MESSAGE_KIND value.

type MessageUsage added in v0.16.0

type MessageUsage struct {

	// IsProduced indicates whether the message is produced by the handler.
	IsProduced bool `protobuf:"varint,2,opt,name=is_produced,json=isProduced,proto3" json:"is_produced,omitempty"`
	// IsConsumed indicates whether the message is consumed by the handler.
	IsConsumed bool `protobuf:"varint,3,opt,name=is_consumed,json=isConsumed,proto3" json:"is_consumed,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageUsage) Descriptor deprecated added in v0.16.0

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

Deprecated: Use MessageUsage.ProtoReflect.Descriptor instead.

func (*MessageUsage) GetIsConsumed added in v0.16.0

func (x *MessageUsage) GetIsConsumed() bool

func (*MessageUsage) GetIsProduced added in v0.16.0

func (x *MessageUsage) GetIsProduced() bool

func (*MessageUsage) ProtoMessage added in v0.16.0

func (*MessageUsage) ProtoMessage()

func (*MessageUsage) ProtoReflect added in v0.16.0

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

func (*MessageUsage) Reset added in v0.16.0

func (x *MessageUsage) Reset()

func (*MessageUsage) SetIsConsumed added in v0.16.0

func (x *MessageUsage) SetIsConsumed(v bool)

SetIsConsumed sets the x.IsConsumed field to v, then returns x.

func (*MessageUsage) SetIsProduced added in v0.16.0

func (x *MessageUsage) SetIsProduced(v bool)

SetIsProduced sets the x.IsProduced field to v, then returns x.

func (*MessageUsage) String added in v0.16.0

func (x *MessageUsage) String() string

type MessageUsageBuilder added in v0.16.0

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

func NewMessageUsageBuilder added in v0.16.0

func NewMessageUsageBuilder() *MessageUsageBuilder

NewMessageUsageBuilder returns a builder that constructs MessageUsage messages.

func (*MessageUsageBuilder) Build added in v0.16.0

func (b *MessageUsageBuilder) Build() *MessageUsage

Build returns a new MessageUsage containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*MessageUsageBuilder) From added in v0.16.0

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*MessageUsageBuilder) WithIsConsumed added in v0.16.0

func (b *MessageUsageBuilder) WithIsConsumed(v bool) *MessageUsageBuilder

WithIsConsumed configures the builder to set the IsConsumed field to v, then returns b.

func (*MessageUsageBuilder) WithIsProduced added in v0.16.0

func (b *MessageUsageBuilder) WithIsProduced(v bool) *MessageUsageBuilder

WithIsProduced configures the builder to set the IsProduced field to v, then returns b.

Jump to

Keyboard shortcuts

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