container

package
v0.0.0-...-42841ab Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 21 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCMD

func DefaultCMD(cfgPath string) ioc.IDig

DefaultCMD creates a basic Container that injects the infrastructure for

- Configuration (IAppConfig)

- Logging (IAppLogger

- Mediator (IMediator)

- EventStoreDB (for EventStore functionality) and

- NATS (for async integration)

MUST: This is the default drivers, for which the SDK provides built-in drivers. It serves as the basis for CMDApps and in order to make it a functioning application, you will need to provide Application-specific AggFtor and ConfigureEventAggBuilder injections as well as the relevant CmdFeatures.

OPTIONAL: You may extend this container by injecting additional Backend Drivers according to your requirements.

func DefaultPRJ

func DefaultPRJ(cfgPath string) ioc.IDig

DefaultPRJ creates a basic Container, discriminated by the type of the ReadModel that injects the infrastructure for

- Configuration (IAppConfig)

- Logging (IAppLogger)

- Mediator (IMediator)

- EventStoreDB (for EventStore functionality) and

- Redis (for caching)

You may extend this container with additional Backend Drivers according to your requirements.

func DefaultQRY

func DefaultQRY(cfgPath string) ioc.IDig

DefaultQRY creates a basic Container that injects the infrastructure for - Configuration (IAppConfig)

- Logging (IAppLogger)

- Mediator (IMediator)

- EventStoreDB (for EventStore functionality)

- NATS (for async integration)

- Redis (for caching)

- ElasticSearch (for free text search)

You may extend this container with additional Backend Drivers according to your requirements.

Types

type App

type App struct {
	*comps.Component
	// contains filtered or unexported fields
}

App is the receiver that serves as the -base for all GO-SCREAM Apps

Definition: CPQRS: "Command GenProjection Query Segregation"

Extending on the principle of CQRS, we separate the responsibility of
Projecting Events from the EventStream to a separate application

Definition: Screaming Architecture:

An architectural style in which all artifacts "scream" their purpose to the observer.
This means that there cmd_must be a clear alignment between discovery and implementation artifacts.

Definition: GO-SCREAM Application:

a GO-SCREAM Applications is conceived as a Screaming Monolith (a form of Majestic Monolith),
where "Features" are the building blocks of the application.
Following the principles of Clean Architecture,  all side effect functionality is addressed via interfaces.

There are 3 types of GO-SCREAM apps:

  1. *-CMD apps that implement pure COMMAND (write) functionality (the "C" in CPQRS)
  2. *-PRJ apps that implement pure PROJECTION (ETL) functionality. (the "P" in CPQRS)
  3. *-QRY apps that implement pure QUERY (read) functionality (the "Q" in CPQRS)

func NewApp

func NewApp(
	config config.IAppConfig,
	run RunAppFunc,
	down DownAppFunc,
) *App

func (*App) Inject

func (a *App) Inject(features ...spokes.ISpoke) spokes.IApp

func (*App) Run

func (a *App) Run() error

Run the App

func (*App) Shutdown

func (a *App) Shutdown(ctx context.Context)

Shutdown shuts down the application

type DownAppFunc

type DownAppFunc func(ctx context.Context)

type RunAppFunc

type RunAppFunc func() error

Jump to

Keyboard shortcuts

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