engine

package
v0.0.0-...-81cdc2d Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine is the framework's instance, it contains the configs, beans and app infos. Create an instance of Engine, by using New()/Default()

func Default

func Default(conf *framework.AppConfig) *Engine

Default returns an Engine instance with a gin bean, the gin server has logger and metrics already attached.

func New

func New(conf *framework.AppConfig) *Engine

New returns a new blank Engine instance without any beans/config attached.

func (*Engine) GetBeanByName

func (e *Engine) GetBeanByName(name string) (framework.Bean, bool)

func (*Engine) GetCommand

func (e *Engine) GetCommand(ctx context.Context) *cobra.Command

func (*Engine) GetConfigByName

func (e *Engine) GetConfigByName(name string) (framework.Config, bool)

func (*Engine) Run

func (e *Engine) Run(ctx context.Context) error

func (*Engine) RunCommand

func (e *Engine) RunCommand(ctx context.Context) error

Run starts the Uitron framework. Note: if there is no bean in beans, Run will not block the calling goroutine.

func (*Engine) UseBean

func (e *Engine) UseBean(name string, conf framework.Config, bean framework.Bean) error

func (*Engine) UseBeanWithConfig

func (e *Engine) UseBeanWithConfig(name string, confBean framework.Bean) error

func (*Engine) UseConfig

func (e *Engine) UseConfig(name string, conf framework.Config) error

func (*Engine) UseConfigs

func (e *Engine) UseConfigs(confs map[string]framework.Config) error

func (*Engine) UseRouterGroups

func (e *Engine) UseRouterGroups(grprouters router.GroupsRouters)

UseRouterGroups is a shortcut for setting default gin routers

func (*Engine) UseRouters

func (e *Engine) UseRouters(routers router.Routers)

UseRouters is a shortcut for setting default gin routers

Jump to

Keyboard shortcuts

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