kernel

package
v0.0.0-...-7c51b95 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(params ...interface{}) error

func GetEnv

func GetEnv(key string) string

Get all env

func New

func New() contract.Application

func NewCommand

func NewCommand(option *CommandOption) contract.BaseCommand

func Recover

func Recover(logger contract.Loggable, params ...interface{})

defer

func RecoverCallback

func RecoverCallback(logger contract.Loggable, callback func(err interface{}, params ...interface{}), params ...interface{})

defer

func SetEnv

func SetEnv(key, value string)

Set env

Types

type Application

type Application struct {
	contract.Container
	// contains filtered or unexported fields
}

func (*Application) Boot

func (a *Application) Boot()

func (*Application) GetProvider

func (a *Application) GetProvider(name string) contract.Provider

func (*Application) HasProvider

func (a *Application) HasProvider(name string) bool

func (*Application) IsDevelopment

func (a *Application) IsDevelopment() bool

func (*Application) IsProduction

func (a *Application) IsProduction() bool

func (*Application) IsTesting

func (a *Application) IsTesting() bool

func (*Application) Mode

func (a *Application) Mode() uint8

func (*Application) PoolValue

func (a *Application) PoolValue(name string) (interface{}, bool)

func (*Application) Register

func (a *Application) Register(provider contract.Provider, force bool)

func (*Application) RegisterMultiple

func (a *Application) RegisterMultiple(providers []contract.Provider, force bool)

func (*Application) RegisterPool

func (a *Application) RegisterPool(name string, poolNew contract.PoolFunc) error

func (*Application) ReleasePool

func (a *Application) ReleasePool(name string, value func() interface{})

func (*Application) Reset

func (a *Application) Reset()

func (*Application) Resolve

func (a *Application) Resolve(abstract interface{}, params ...interface{}) interface{}

func (*Application) SetMode

func (a *Application) SetMode(mode uint8)

func (*Application) Version

func (a *Application) Version() string

type BaseProvider

type BaseProvider struct {
	Config      contract.Configuration `inject:"config"`
	Application contract.Application   `inject:"application"`
}

func (*BaseProvider) Bind

func (p *BaseProvider) Bind(name string, prototype interface{}, options ...support.Option)

func (*BaseProvider) BindConfig

func (p *BaseProvider) BindConfig(key string, object interface{}) error

func (*BaseProvider) Resolve

func (p *BaseProvider) Resolve(abstract interface{}, params ...interface{}) interface{}

type CommandOption

type CommandOption struct {
	ConfigPath string
	Providers  []contract.Provider
	Commands   []contract.Command
	Mount      func(app contract.Application)
}

type Config

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

func NewConfig

func NewConfig(path string) *Config

Create a new config instance

func (*Config) Bind

func (c *Config) Bind(name string, object interface{}) error

func (*Config) Clone

func (c *Config) Clone() contract.Configuration

func (*Config) Exists

func (c *Config) Exists(key string) bool

Determine if the specified key exists

func (*Config) Get

func (c *Config) Get(key string) interface{}

Get the value of the specified key

func (*Config) GetBool

func (c *Config) GetBool(key string) bool

Get the bool value of the specified key

func (*Config) GetDuration

func (c *Config) GetDuration(key string) time.Duration

Get the time duration value of the specified key

func (*Config) GetFloat

func (c *Config) GetFloat(key string) float64

Get the float value of the specified key

func (*Config) GetInt

func (c *Config) GetInt(key string) int

Get the int value of the specified key

func (*Config) GetIntSlice

func (c *Config) GetIntSlice(key string) []int

Get the int slice value of the specified key

func (*Config) GetString

func (c *Config) GetString(key string) string

Get the string value of the specified key

func (*Config) GetStringMap

func (c *Config) GetStringMap(key string) map[string]interface{}

Get the string map value of the specified key

func (*Config) GetStringMapString

func (c *Config) GetStringMapString(key string) map[string]string

Get the string map string value of the specified key

func (*Config) GetStringSlice

func (c *Config) GetStringSlice(key string) []string

Get the string slice value of the specified key

func (*Config) GetTime

func (c *Config) GetTime(key string) time.Time

Get the time type value of the specified key

func (*Config) Set

func (c *Config) Set(key string, value interface{})

Set configuration value

func (*Config) SetDefault

func (c *Config) SetDefault(key string, value interface{})

Set item default value if not exists

type SchedulerRecoverError

type SchedulerRecoverError struct {
	Message string
	Recover interface{}
}

func (SchedulerRecoverError) Error

func (s SchedulerRecoverError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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