interfaces

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: BSD-2-Clause Imports: 2 Imported by: 15

Documentation

Index

Constants

View Source
const (
	PkgCache      = "cache"
	PkgDatabase   = "database"
	PkgClient     = "client"
	PkgServer     = "server"
	PkgStorage    = "storage"
	PkgMiddleware = "middleware"
	PkgLogger     = "logger"
	PkgExternal   = "external"
)
View Source
const (
	ModuleController = "controller"
	ModuleRepository = "repository"
	ModuleService    = "service"
	ModuleMiddleware = "middleware"
	ModuleModule     = "module"
	ModuleCustom     = "custom"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IConfig

type IConfig interface {
	Init(app IEngine) error
	Stop() error
	Has(key string) bool
	GetString(key string, def string) string
	GetBool(key string, def bool) bool
	GetInt(key string, def int) int
	GetFloat(key string, def float64) float64

	GetMapString(key string, def map[string]string) map[string]string
	GetMapBool(key string, def map[string]bool) map[string]bool
	GetMapInt(key string, def map[string]int) map[string]int
	GetMapFloat(key string, def map[string]float64) map[string]float64
	GetMapInterface(key string, def map[string]interface{}) map[string]interface{}

	GetSliceString(key string, def []string) []string
	GetSliceBool(key string, def []bool) []bool
	GetSliceInt(key string, def []int) []int
	GetSliceFloat(key string, def []float64) []float64
	GetSliceInterface(key string, def []interface{}) []interface{}

	GetConfigItem(typeName string, name string) map[string]interface{}
}

type IEngine

type IEngine interface {
	Init() error
	Stop() error
	GetLogger() ILogger
	GetConfig() IConfig
	SetMetrics(c IMetrics)
	SetTrace(c ITrace)

	PushPkg(c IPkg) IEngine
	GetPkg(typePkg string, key string) IPkg

	PushModule(c IModules) IEngine
	GetModule(typePkg string, key string) IModules

	PushTask(c ITask) IEngine
	GetTask(key string) ITask
	RemoveTask(key string)
	RunTask(key string, args map[string]interface{}) error
}

type ILogger

type ILogger interface {
	Init(map[string]interface{}) error
	Stop() error
	Name() string
	Type() string
	Debug(ctx context.Context, args ...interface{})
	Info(ctx context.Context, args ...interface{})
	Warn(ctx context.Context, args ...interface{})
	Message(ctx context.Context, args ...interface{})
	Error(ctx context.Context, err error)
	Fatal(ctx context.Context, err error)
	Panic(ctx context.Context, err error)
	Parent() interface{}
	SetParent(interface{})
}

type IMetrics

type IMetrics interface {
	Init(cfg map[string]interface{}) error
	Start() error
	Stop() error
	Name() string
}

type IMiddleware

type IMiddleware interface {
	Init(app IEngine, cfg map[string]interface{}) error
	Stop() error
	Name() string
	Type() string
}

type IModules

type IModules interface {
	Init(app IEngine, cfg map[string]interface{}) error
	Stop() error
	Name() string
	Type() string
}

type IPkg

type IPkg interface {
	Init(cfg map[string]interface{}) error
	Stop() error
	Name() string
	Type() string
}

type IServer

type IServer interface {
	Init(cfg map[string]interface{}) error
	Start() error
	Stop() error
	Name() string
	Type() string
}

type ITask

type ITask interface {
	Init(app IEngine) error
	Stop() error
	Name() string
	Start() []ITaskRunConfiguration
	Invoke(ctx context.Context, data map[string]interface{})
}

type ITaskRunConfiguration

type ITaskRunConfiguration interface {
}

type ITrace

type ITrace interface {
	Init(cfg map[string]interface{}) error
	Start() error
	Stop() error
	Name() string
}

type TaskRunAfter

type TaskRunAfter struct {
	ITaskRunConfiguration
	Restart <-chan time.Duration
	After   time.Duration
}

type TaskRunTime

type TaskRunTime struct {
	ITaskRunConfiguration
	Restart <-chan time.Time
	To      time.Time
}

Jump to

Keyboard shortcuts

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