application

package
v0.0.0-...-5d322a5 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 8 Imported by: 0

README

application

The application is the whole program that should be run in our binary.

Every application contains the following parts:

Usage

app := application.New(ctx, cfg.ServerPort)

app.AddDependency(dependency.NewSQL(db))
// you can add more here

app.AddBoundedContext(firstBoundedContext)
app.AddBoundedContext(secondBoundedContext)
// you can add more here

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is an instance of the whole application. It holds the basic information about all dependencies it has and application-wide configuration. Any Module can be registered using the app.AddModule() function

func New

func New(ctx context.Context, port int) *App

New creates a new instance of the application.

func (*App) AddBoundedContext

func (app *App) AddBoundedContext(bc BoundedContext)

func (*App) AddDependency

func (app *App) AddDependency(dep dependency.Dependency)

func (*App) Close

func (app *App) Close(ctx context.Context) error

func (*App) Run

func (app *App) Run() error

For debugging purpose, it exports

type BoundedContext

type BoundedContext interface {
}

type MuxRegister

type MuxRegister interface {
	MuxRegister(*mux.Router)
}

Jump to

Keyboard shortcuts

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