configpb

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 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"`
	// 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) 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) 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.

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"`
	// ProducedMessages is the set of messages produced by this handler.
	//
	// The keys are the fully-qualified names of the message's Go type and the
	// value is the kind of message implemented by that type.
	ProducedMessages map[string]MessageKind `` /* 230-byte string literal not displayed */
	// ConsumedMessages is the set of messages consumed by this handler.
	//
	// The keys are the fully-qualified names of the message's Go type and the
	// value is the kind of message implemented by that type.
	ConsumedMessages map[string]MessageKind `` /* 230-byte string literal not displayed */
	// IsDisabled indicates whether the handler is disabled.
	IsDisabled bool `protobuf:"varint,6,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) GetConsumedMessages

func (x *Handler) GetConsumedMessages() map[string]MessageKind

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) GetProducedMessages

func (x *Handler) GetProducedMessages() map[string]MessageKind

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) SetConsumedMessages

func (x *Handler) SetConsumedMessages(v map[string]MessageKind)

SetConsumedMessages sets the x.ConsumedMessages field to v, then returns x.

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) SetProducedMessages

func (x *Handler) SetProducedMessages(v map[string]MessageKind)

SetProducedMessages sets the x.ProducedMessages 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) WithConsumedMessages

func (b *HandlerBuilder) WithConsumedMessages(v map[string]MessageKind) *HandlerBuilder

WithConsumedMessages configures the builder to set the ConsumedMessages field to v, then returns b.

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) WithProducedMessages

func (b *HandlerBuilder) WithProducedMessages(v map[string]MessageKind) *HandlerBuilder

WithProducedMessages configures the builder to set the ProducedMessages 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.

Jump to

Keyboard shortcuts

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