configbuilder

package
v0.19.8 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package configbuilder provides utilities for building configuration components.

It validates that the componenets are well-formed without requiring that they represent validation configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate

func Aggregate(fn func(*AggregateBuilder)) *config.Aggregate

Aggregate returns a new config.AggregateX as configured by fn.

func Application

func Application(fn func(*ApplicationBuilder)) *config.Application

Application returns a new config.Application as configured by fn.

func Flag

func Flag[S config.Symbol](fn func(*FlagBuilder[S])) *config.Flag[S]

Flag returns a new config.FlagModification as configured by fn.

func Identity

func Identity(fn func(*IdentityBuilder)) *config.Identity

Identity returns a new config.Identity as configured by fn.

func Integration

func Integration(fn func(*IntegrationBuilder)) *config.Integration

Integration returns a new config.Integration as configured by fn.

func Process

func Process(fn func(*ProcessBuilder)) *config.Process

Process returns a new config.Process as configured by fn.

func Projection

func Projection(fn func(*ProjectionBuilder)) *config.Projection

Projection returns a new config.Projection as configured by fn.

func Route

func Route(fn func(*RouteBuilder)) *config.Route

Route returns a new config.Route as configured by fn.

Types

type AggregateBuilder

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

AggregateBuilder constructs a config.Aggregate.

func (*AggregateBuilder) Disabled

func (b *AggregateBuilder) Disabled(fn func(*FlagBuilder[config.Disabled]))

Disabled calls fn which configures a config.FlagModification that is added to the handler's disabled flag.

func (*AggregateBuilder) Done

func (b *AggregateBuilder) Done() *config.Aggregate

Done completes the configuration of the handler.

func (*AggregateBuilder) Identity

func (b *AggregateBuilder) Identity(fn func(*IdentityBuilder))

Identity calls fn which configures a config.Identity that is added to the handler.

func (*AggregateBuilder) Partial

func (b *AggregateBuilder) Partial()

Partial marks the compomnent as partially configured.

func (*AggregateBuilder) Route

func (b *AggregateBuilder) Route(fn func(*RouteBuilder))

Route calls fn which configures a config.Route that is added to the handler.

func (*AggregateBuilder) Source

Source sets the source value to h.

func (*AggregateBuilder) Speculative

func (b *AggregateBuilder) Speculative()

Speculative marks the component as speculative.

func (*AggregateBuilder) TypeName

func (b *AggregateBuilder) TypeName(n string)

TypeName sets the name of the concrete type that implements dogma.AggregateMessageHandler.

type ApplicationBuilder

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

ApplicationBuilder constructs a config.Application.

func (*ApplicationBuilder) Aggregate

func (b *ApplicationBuilder) Aggregate(fn func(*AggregateBuilder))

Aggregate calls fn which configures a config.Aggregate that is added to the application.

func (*ApplicationBuilder) Done

Done sanity checks the configuration and returns the completed component.

func (*ApplicationBuilder) Identity

func (b *ApplicationBuilder) Identity(fn func(*IdentityBuilder))

Identity calls fn which configures a config.Identity that is added to the application.

func (*ApplicationBuilder) Integration

func (b *ApplicationBuilder) Integration(fn func(*IntegrationBuilder))

Integration calls fn which configures a config.Integration that is added to the application.

func (*ApplicationBuilder) Partial

func (b *ApplicationBuilder) Partial()

Partial marks the compomnent as partially configured.

func (*ApplicationBuilder) Process

func (b *ApplicationBuilder) Process(fn func(*ProcessBuilder))

Process calls fn which configures a config.Process that is added to the application.

func (*ApplicationBuilder) Projection

func (b *ApplicationBuilder) Projection(fn func(*ProjectionBuilder))

Projection calls fn which configures a config.Projection that is added to the application.

func (*ApplicationBuilder) Source

func (b *ApplicationBuilder) Source(app dogma.Application)

Source sets the source value to app.

func (*ApplicationBuilder) Speculative

func (b *ApplicationBuilder) Speculative()

Speculative marks the component as speculative.

func (*ApplicationBuilder) TypeName

func (b *ApplicationBuilder) TypeName(n string)

TypeName sets the name of the concrete type that implements dogma.Application.

type ComponentBuilder

type ComponentBuilder[T config.Component] interface {
	Partial()
	Speculative()
	Done() T
}

ComponentBuilder an interface for builders that produce a config.Component.

type EntityBuilder

type EntityBuilder[T config.Entity, E any] interface {
	ComponentBuilder[T]

	// TypeName sets the name of the concrete type that implements the
	// entity.
	TypeName(n string)

	// Source sets the source value to h.
	Source(E)

	// Identity calls fn which configures a [config.Identity] that is added to
	// the handler.
	Identity(fn func(*IdentityBuilder))
}

EntityBuilder an interface for builders that produce a config.Entity.

type FlagBuilder

type FlagBuilder[S config.Symbol] struct {
	// contains filtered or unexported fields
}

FlagBuilder constructs a config.FlagModification.

func (*FlagBuilder[S]) Done

func (b *FlagBuilder[S]) Done() *config.Flag[S]

Done completes the configuration of the flag.

func (*FlagBuilder[S]) Partial

func (b *FlagBuilder[S]) Partial()

Partial marks the compomnent as partially configured.

func (*FlagBuilder[S]) Speculative

func (b *FlagBuilder[S]) Speculative()

Speculative marks the component as speculative.

func (*FlagBuilder[S]) Value

func (b *FlagBuilder[S]) Value(v bool)

Value sets the value of the target config.FlagModification.

type HandlerBuilder

type HandlerBuilder[T config.Handler, H any] interface {
	EntityBuilder[T, H]

	// Route calls fn which configures a [config.Route] that is added to the
	// handler.
	Route(fn func(*RouteBuilder))

	// Disabled calls fn which configures a [config.FlagModification] that is
	// added to the handler's disabled flag.
	Disabled(fn func(*FlagBuilder[config.Disabled]))
}

HandlerBuilder an interface for builders that produce a config.Handler.

type IdentityBuilder

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

IdentityBuilder constructs a config.Identity.

func (*IdentityBuilder) Done

func (b *IdentityBuilder) Done() *config.Identity

Done completes the configuration of the identity.

func (*IdentityBuilder) Key

func (b *IdentityBuilder) Key(key string)

Key sets the key element of the identity.

func (*IdentityBuilder) Name

func (b *IdentityBuilder) Name(name string)

Name sets the name element of the identity.

func (*IdentityBuilder) Partial

func (b *IdentityBuilder) Partial()

Partial marks the compomnent as partially configured.

func (*IdentityBuilder) Speculative

func (b *IdentityBuilder) Speculative()

Speculative marks the component as speculative.

func (*IdentityBuilder) TargetComponent

func (b *IdentityBuilder) TargetComponent() config.Component

TargetComponent returns the component that is being configured.

type IntegrationBuilder

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

IntegrationBuilder constructs a config.Integration.

func (*IntegrationBuilder) Disabled

func (b *IntegrationBuilder) Disabled(fn func(*FlagBuilder[config.Disabled]))

Disabled calls fn which configures a config.FlagModification that is added to the handler's disabled flag.

func (*IntegrationBuilder) Done

Done completes the configuration of the handler.

func (*IntegrationBuilder) Identity

func (b *IntegrationBuilder) Identity(fn func(*IdentityBuilder))

Identity calls fn which configures a config.Identity that is added to the handler.

func (*IntegrationBuilder) Partial

func (b *IntegrationBuilder) Partial()

Partial marks the compomnent as partially configured.

func (*IntegrationBuilder) Route

func (b *IntegrationBuilder) Route(fn func(*RouteBuilder))

Route calls fn which configures a config.Route that is added to the handler.

func (*IntegrationBuilder) Source

Source sets the source value to h.

func (*IntegrationBuilder) Speculative

func (b *IntegrationBuilder) Speculative()

Speculative marks the component as speculative.

func (*IntegrationBuilder) TypeName

func (b *IntegrationBuilder) TypeName(n string)

TypeName sets the name of the concrete type that implements dogma.IntegrationMessageHandler.

type ProcessBuilder

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

ProcessBuilder constructs a config.Process.

func (*ProcessBuilder) Disabled

func (b *ProcessBuilder) Disabled(fn func(*FlagBuilder[config.Disabled]))

Disabled calls fn which configures a config.FlagModification that is added to the handler's disabled flag.

func (*ProcessBuilder) Done

func (b *ProcessBuilder) Done() *config.Process

Done completes the configuration of the handler.

func (*ProcessBuilder) Identity

func (b *ProcessBuilder) Identity(fn func(*IdentityBuilder))

Identity calls fn which configures a config.Identity that is added to the handler.

func (*ProcessBuilder) Partial

func (b *ProcessBuilder) Partial()

Partial marks the compomnent as partially configured.

func (*ProcessBuilder) Route

func (b *ProcessBuilder) Route(fn func(*RouteBuilder))

Route calls fn which configures a config.Route that is added to the handler.

func (*ProcessBuilder) Source

Source sets the source value to h.

func (*ProcessBuilder) Speculative

func (b *ProcessBuilder) Speculative()

Speculative marks the component as speculative.

func (*ProcessBuilder) TypeName

func (b *ProcessBuilder) TypeName(n string)

TypeName sets the name of the concrete type that implements dogma.ProcessMessageHandler.

type ProjectionBuilder

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

ProjectionBuilder constructs a config.Projection.

func (*ProjectionBuilder) Disabled

func (b *ProjectionBuilder) Disabled(fn func(*FlagBuilder[config.Disabled]))

Disabled calls fn which configures a config.FlagModification that is added to the handler's disabled flag.

func (*ProjectionBuilder) Done

func (b *ProjectionBuilder) Done() *config.Projection

Done completes the configuration of the handler.

func (*ProjectionBuilder) Identity

func (b *ProjectionBuilder) Identity(fn func(*IdentityBuilder))

Identity calls fn which configures a config.Identity that is added to the handler.

func (*ProjectionBuilder) Partial

func (b *ProjectionBuilder) Partial()

Partial marks the compomnent as partially configured.

func (*ProjectionBuilder) Route

func (b *ProjectionBuilder) Route(fn func(*RouteBuilder))

Route calls fn which configures a config.Route that is added to the handler.

func (*ProjectionBuilder) Source

Source sets the source value to h.

func (*ProjectionBuilder) Speculative

func (b *ProjectionBuilder) Speculative()

Speculative marks the component as speculative.

func (*ProjectionBuilder) TypeName

func (b *ProjectionBuilder) TypeName(n string)

TypeName sets the name of the concrete type that implements dogma.ProjectionMessageHandler.

type RouteBuilder

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

RouteBuilder constructs a config.Route.

func (*RouteBuilder) AsPerRoute

func (b *RouteBuilder) AsPerRoute(r dogma.MessageRoute)

AsPerRoute configures the builder to use the same properties as r.

func (*RouteBuilder) Done

func (b *RouteBuilder) Done() *config.Route

Done completes the configuration of the route.

func (*RouteBuilder) MessageType

func (b *RouteBuilder) MessageType(t message.Type)

MessageType sets the message type of the route.

func (*RouteBuilder) MessageTypeName

func (b *RouteBuilder) MessageTypeName(name string)

MessageTypeName sets the message type name of the route.

func (*RouteBuilder) Partial

func (b *RouteBuilder) Partial()

Partial marks the compomnent as partially configured.

func (*RouteBuilder) RouteType

func (b *RouteBuilder) RouteType(t config.RouteType)

RouteType sets the route type of the route.

func (*RouteBuilder) Speculative

func (b *RouteBuilder) Speculative()

Speculative marks the component as speculative.

Jump to

Keyboard shortcuts

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