app

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationContainer

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

func NewContainer

func NewContainer(opts ContainerOpts) *ApplicationContainer

func (*ApplicationContainer) Invoke

func (c *ApplicationContainer) Invoke(name string) (interface{}, error)

func (*ApplicationContainer) InvokeByType

func (c *ApplicationContainer) InvokeByType(obj interface{}) (interface{}, error)

func (*ApplicationContainer) InvokeByTypeP

func (c *ApplicationContainer) InvokeByTypeP(obj interface{}) interface{}

func (*ApplicationContainer) InvokeP

func (c *ApplicationContainer) InvokeP(name string) interface{}

func (*ApplicationContainer) Logger

func (c *ApplicationContainer) Logger() *slog.Logger

func (*ApplicationContainer) Register

func (c *ApplicationContainer) Register(name string, obj interface{}) error

func (*ApplicationContainer) Run

func (c *ApplicationContainer) Run()

func (*ApplicationContainer) WithNamedProvider

func (c *ApplicationContainer) WithNamedProvider(name string, provider IProvider) *ApplicationContainer

func (*ApplicationContainer) WithProvider

func (c *ApplicationContainer) WithProvider(provider IProvider) *ApplicationContainer

type BaseProvider

type BaseProvider struct{}

func (*BaseProvider) OnRegister

func (p *BaseProvider) OnRegister() func() error

func (*BaseProvider) OnStart

func (p *BaseProvider) OnStart() func() error

func (*BaseProvider) OnStop

func (p *BaseProvider) OnStop() func() error

type ContainerLogsOpts

type ContainerLogsOpts struct {
	W io.Writer
	L slog.Leveler
}

type ContainerOpts

type ContainerOpts struct {
	Log ContainerLogsOpts
}

type IApp

type IApp interface {
	IContainer
	Run()
	// contains filtered or unexported methods
}

type IContainer

type IContainer interface {
	IContainerMonitor
	Register(name string, obj interface{}) error
	Invoke(name string) (interface{}, error)
	InvokeP(name string) interface{}
	InvokeByType(obj interface{}) (interface{}, error)
	InvokeByTypeP(obj interface{}) interface{}
}

type IContainerMonitor

type IContainerMonitor interface {
	Logger() *slog.Logger
}

type IProvider

type IProvider interface {
	Provide(lf IContainer) (interface{}, error)
	OnRegister() func() error
	OnStart() func() error
	OnStop() func() error
}

Jump to

Keyboard shortcuts

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