center

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &DefaultCenter{
	Manager: server.New(),
}

Functions

func GetCache added in v0.3.0

func GetCache() storage.AdapterCache

func GetDB

func GetDB(ctx *gin.Context, table schema.Tabler) *gorm.DB

func GetLocker added in v0.3.0

func GetLocker() storage.AdapterLocker

func GetProfiler

func GetProfiler() *pyroscope.Profiler

func GetQueue added in v0.3.0

func GetQueue() storage.AdapterQueue

func GetRouter

func GetRouter() gin.IRouter

func GetServerManager

func GetServerManager() server.Manager

func Stage

func Stage() string

Types

type AppConfigImp

type AppConfigImp interface {
	SetAppConfig(ctx *gin.Context, key string, auth bool, value string) error
	GetAppConfig(ctx *gin.Context, key string) (string, bool)
}

func GetAppConfig

func GetAppConfig() AppConfigImp

type ConfigImp

type ConfigImp interface {
	source.Entity
	Init(...source.Option)
}

func GetConfig

func GetConfig() ConfigImp

type CustomConfigImp added in v0.4.6

type CustomConfigImp interface {
	ConfigImp
}

func GetCustomConfig added in v0.4.6

func GetCustomConfig() CustomConfigImp

type DefaultCenter

func SetAppConfig

func SetAppConfig(a AppConfigImp) *DefaultCenter

func SetCache added in v0.3.0

func SetCache(c storage.AdapterCache) *DefaultCenter

func SetConfig

func SetConfig(e ConfigImp) *DefaultCenter

func SetCustomConfig added in v0.4.6

func SetCustomConfig(e CustomConfigImp) *DefaultCenter

func SetGRPCClient

func SetGRPCClient(g GRPCClientImp) *DefaultCenter

func SetLocker added in v0.3.0

func SetLocker(l storage.AdapterLocker) *DefaultCenter

func SetMakeRouter

func SetMakeRouter(m MakeRouterImp) *DefaultCenter

func SetNotice

func SetNotice(n NoticeImp) *DefaultCenter

func SetProfiler

func SetProfiler(p *pyroscope.Profiler) *DefaultCenter

func SetQueue added in v0.3.0

func SetQueue(q storage.AdapterQueue) *DefaultCenter

func SetRouter

func SetRouter(r gin.IRouter) *DefaultCenter

func SetServerManager

func SetServerManager(m server.Manager) *DefaultCenter

func SetStatistics

func SetStatistics(s StatisticsImp) *DefaultCenter

func SetTenant

func SetTenant(t TenantImp) *DefaultCenter

func SetTenantMigrator added in v0.4.4

func SetTenantMigrator(t TenantMigrator) *DefaultCenter

func SetUserConfig added in v0.3.0

func SetUserConfig(u UserConfigImp) *DefaultCenter

func SetVerify

func SetVerify(v security.Verifier) *DefaultCenter

func SetVerifyCodeStore added in v0.4.6

func SetVerifyCodeStore(v VerifyCodeStoreImp) *DefaultCenter

func SetVirtualModel

func SetVirtualModel(v VirtualModelImp) *DefaultCenter

func (*DefaultCenter) GetAppConfig

func (d *DefaultCenter) GetAppConfig() AppConfigImp

func (*DefaultCenter) GetCache added in v0.3.0

func (d *DefaultCenter) GetCache() storage.AdapterCache

func (*DefaultCenter) GetConfig

func (d *DefaultCenter) GetConfig() ConfigImp

func (*DefaultCenter) GetCustomConfig added in v0.4.6

func (d *DefaultCenter) GetCustomConfig() CustomConfigImp

func (*DefaultCenter) GetGRPCClient added in v0.3.0

func (d *DefaultCenter) GetGRPCClient() GRPCClientImp

func (*DefaultCenter) GetLocker added in v0.3.0

func (d *DefaultCenter) GetLocker() storage.AdapterLocker

func (*DefaultCenter) GetMakeRouter

func (d *DefaultCenter) GetMakeRouter() MakeRouterImp

func (*DefaultCenter) GetNotice

func (d *DefaultCenter) GetNotice() NoticeImp

func (*DefaultCenter) GetProfiler

func (d *DefaultCenter) GetProfiler() *pyroscope.Profiler

func (*DefaultCenter) GetQueue added in v0.3.0

func (d *DefaultCenter) GetQueue() storage.AdapterQueue

func (*DefaultCenter) GetRouter

func (d *DefaultCenter) GetRouter() gin.IRouter

func (*DefaultCenter) GetServerManager

func (d *DefaultCenter) GetServerManager() server.Manager

func (*DefaultCenter) GetStatistics

func (d *DefaultCenter) GetStatistics() StatisticsImp

func (*DefaultCenter) GetTenant

func (d *DefaultCenter) GetTenant() TenantImp

func (*DefaultCenter) GetTenantMigrator added in v0.4.4

func (d *DefaultCenter) GetTenantMigrator() TenantMigrator

func (*DefaultCenter) GetUserConfig added in v0.3.0

func (d *DefaultCenter) GetUserConfig() UserConfigImp

func (*DefaultCenter) GetVerify

func (d *DefaultCenter) GetVerify() UserImp

func (*DefaultCenter) GetVerifyCodeStore added in v0.4.6

func (d *DefaultCenter) GetVerifyCodeStore() VerifyCodeStoreImp

func (*DefaultCenter) GetVirtualModel

func (d *DefaultCenter) GetVirtualModel() VirtualModelImp

func (*DefaultCenter) SetAppConfig

func (d *DefaultCenter) SetAppConfig(a AppConfigImp)

func (*DefaultCenter) SetCache added in v0.3.0

func (d *DefaultCenter) SetCache(c storage.AdapterCache)

func (*DefaultCenter) SetConfig

func (d *DefaultCenter) SetConfig(e ConfigImp)

func (*DefaultCenter) SetCustomConfig added in v0.4.6

func (d *DefaultCenter) SetCustomConfig(e CustomConfigImp)

func (*DefaultCenter) SetGRPCClient

func (d *DefaultCenter) SetGRPCClient(g GRPCClientImp)

func (*DefaultCenter) SetLocker added in v0.3.0

func (d *DefaultCenter) SetLocker(l storage.AdapterLocker)

func (*DefaultCenter) SetMakeRouter

func (d *DefaultCenter) SetMakeRouter(m MakeRouterImp)

func (*DefaultCenter) SetNotice

func (d *DefaultCenter) SetNotice(n NoticeImp)

func (*DefaultCenter) SetProfiler

func (d *DefaultCenter) SetProfiler(p *pyroscope.Profiler)

func (*DefaultCenter) SetQueue added in v0.3.0

func (d *DefaultCenter) SetQueue(q storage.AdapterQueue)

func (*DefaultCenter) SetRouter

func (d *DefaultCenter) SetRouter(r gin.IRouter)

func (*DefaultCenter) SetServerManager

func (d *DefaultCenter) SetServerManager(m server.Manager)

func (*DefaultCenter) SetStatistics

func (d *DefaultCenter) SetStatistics(s StatisticsImp)

func (*DefaultCenter) SetTenant

func (d *DefaultCenter) SetTenant(t TenantImp)

func (*DefaultCenter) SetTenantMigrator added in v0.4.4

func (d *DefaultCenter) SetTenantMigrator(t TenantMigrator)

func (*DefaultCenter) SetUserConfig added in v0.3.0

func (d *DefaultCenter) SetUserConfig(u UserConfigImp)

func (*DefaultCenter) SetVerify

func (d *DefaultCenter) SetVerify(v UserImp)

func (*DefaultCenter) SetVerifyCodeStore added in v0.4.6

func (d *DefaultCenter) SetVerifyCodeStore(v VerifyCodeStoreImp)

func (*DefaultCenter) SetVirtualModel

func (d *DefaultCenter) SetVirtualModel(v VirtualModelImp)

func (*DefaultCenter) Stage

func (d *DefaultCenter) Stage() string

type GRPCClientImp

type GRPCClientImp interface {
	GetGRPCClient(string, ...grpc.DialOption) *grpc.ClientConn
}

func GetGRPCClient added in v0.3.0

func GetGRPCClient() GRPCClientImp

type MakeRouterImp

type MakeRouterImp interface {
	SetFunc(...func(*gin.RouterGroup))
	GetFunc() []func(*gin.RouterGroup)
	MakeRouter(*gin.RouterGroup)
}

func GetMakeRouter

func GetMakeRouter() MakeRouterImp

type NoticeImp

type NoticeImp interface {
	List(ctx *gin.Context, userID string, page, size int) ([]NoticeImp, int, error)
	Unread(ctx *gin.Context, userID string) ([]NoticeImp, error)
	Read(ctx *gin.Context, userID string, ids []string) error
	Send(ctx *gin.Context, userID string, noticer NoticeImp) error
}

func GetNotice

func GetNotice() NoticeImp

type StageImp

type StageImp interface {
	Stage() string
}

type StatisticsImp

type StatisticsImp interface {
	Calibrate(ctx *gin.Context, object StatisticsObject) error
	NowIncrease(ctx *gin.Context, object StatisticsObject) error
	NowReduce(ctx *gin.Context, object StatisticsObject) error
}

func GetStatistics

func GetStatistics() StatisticsImp

type StatisticsObject

type StatisticsObject interface {
	StatisticsType() string
	StatisticsName() string
	StatisticsTime() string
	// StatisticsStep 统计步长 * 100
	StatisticsStep() int
	StatisticsCalibrate() (int, error)
}

type TenantImp

type TenantImp interface {
	Scope(ctx *gin.Context, table schema.Tabler) func(db *gorm.DB) *gorm.DB
	GetTenant(ctx *gin.Context) (TenantImp, error)
	GetDB(ctx *gin.Context, table schema.Tabler) *gorm.DB
	GetID() any
	GetDefault() bool
}

func GetTenant

func GetTenant() TenantImp

type TenantMigrator added in v0.4.4

type TenantMigrator interface {
	Migrate(t TenantImp, tx *gorm.DB) error
}

func GetTenantMigrator added in v0.4.4

func GetTenantMigrator() TenantMigrator

type UserConfigImp added in v0.3.0

type UserConfigImp interface {
	SetUserConfig(ctx *gin.Context, userID, key, value string) error
	GetUserConfig(ctx *gin.Context, userID, key string) (string, bool)
}

func GetUserConfig added in v0.3.0

func GetUserConfig() UserConfigImp

type UserImp

type UserImp interface {
	security.Verifier
}

func GetUser

func GetUser() UserImp

type VerifyCodeStoreImp added in v0.4.6

type VerifyCodeStoreImp interface {
	GenerateCode(ctx context.Context, key string, expire time.Duration) (string, error)
	VerifyCode(ctx context.Context, key, code string) (bool, error)
}

func GetVerifyCodeStore added in v0.4.6

func GetVerifyCodeStore() VerifyCodeStoreImp

type VirtualModelImp

type VirtualModelImp interface {
	GetModels(ctx *gin.Context) ([]VirtualModelImp, error)
	Make() *model.Model
	GetKey() string
}

func GetVirtualModel

func GetVirtualModel() VirtualModelImp

Jump to

Keyboard shortcuts

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