types

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppComponentCtor

type AppComponentCtor = func(app IApp) IAppComponent

type AppControllerCtor

type AppControllerCtor = func(component IAppComponent) IAppController

type IAccessPolicy

type IAccessPolicy string
const (
	AccessPolicyPublic        IAccessPolicy = "public"
	AccessPolicyAuthenticated IAccessPolicy = "authenticated"
	AccessPolicyAdmin         IAccessPolicy = "admin"
)

type IApp

type IApp interface {
	ILoggable
	GetName() string
	GetVersion() string
	GetDocs() *swag.Spec
	GetUI() *embed.FS
	GetConfig() *embed.FS
	SetLogger(logger ILogger)
	GetComponents() []IAppComponent
	GetComponent(name string) IAppComponent
	GetKernel() IKernel
	SetKernel(kernel IKernel)
}

type IAppComponent

type IAppComponent interface {
	ILoggable
	GetName() string
	GetOrder() int
	GetApp() IApp
	GetConfig() *embed.FS
	GetDocs() *swag.Spec
	GetUI() *embed.FS
	GetAccessPolicy() IAccessPolicy
	GetControllers() []IAppController
	GetController(name string) IAppController

	Init() error
	Register(r *gin.RouterGroup) error
	Start() error
	Stop() error
}

type IAppController

type IAppController interface {
	ILoggable
	GetName() string
	GetOrder() int
	GetComponent() IAppComponent
	GetConfig() *embed.FS

	Init() error
	Register(r *gin.RouterGroup) error
	Start() error
	Stop() error
}

type IKernel

type IKernel interface {
	ILoggable
	GetApp() IApp
	GetRunDirectory() string
	GetRootContext() context.Context
	GetService(key KernelServiceContextKey) IKernelService
	SetService(service IKernelService)
	Init() error
	Register() error
	Start() error
	ListenAndServe() error
}

type IKernelService

type IKernelService interface {
	ILoggable
	GetName() string
	GetKernel() IKernel
	GetConfig(key string) string
	SetConfig(key string, value string)
	GetData(key string) interface{}
	SetData(key string, value interface{})
	Init() error
	Register() error
	Start() error
	Stop() error
}

type ILoggable

type ILoggable interface {
	GetLogger() ILogger
}

type ILogger

type ILogger interface {
	GetName() string
	CreateSubLogger(name string) ILogger
	Scope(name string, handler func(log ILogger) error) error
	ScopeWithReturn(name string, handler func(log ILogger) (any, error)) (any, error)
	GetBaseLogger() *logrus.Entry
	Trace(message string)
	TraceF(format string, args ...interface{})
	Debug(message string)
	DebugF(format string, args ...interface{})
	Info(message string)
	InfoF(format string, args ...interface{})
	Warn(message string)
	WarnF(format string, args ...interface{})
	Error(message string)
	ErrorF(format string, args ...interface{})
	Panic(message string)
	PanicF(format string, args ...interface{})
}

type KernelServiceContextKey

type KernelServiceContextKey string

Jump to

Keyboard shortcuts

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