contracts

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IApplication

type IApplication interface {
	Bind(string, ServiceFunc, ...bool)
	Singleton(string, ServiceFunc)
	Make(string) interface{}
	Register(interface{})
	InjectApp(interface{}) interface{}
	Name() string
	RegistEvent(interface{})
	GetRoutesTree() interface{}
	GetRoutesGroup() interface{}
	GetEngine() *gin.Engine
	Use(...interface{})
	NoRoute(...interface{})
}

app接口暴露给注入app的结构体

type IAuth

type IAuth interface {
	Check() bool
	Guest() bool
	User() IUser
	ID() string
	Attempt(map[string]interface{}, ...bool) bool
	Validate(map[string]interface{}) bool
	Login(IUser, ...bool)
	Logout()
	SetUser(IUser)
	WithContext(*gin.Context) IAuth
}

用户登录接口

type IAuthManager

type IAuthManager interface {
	Guard(...string) IAuth
}

登录管理接口

type IEvent

type IEvent interface {
	Data() map[string]interface{}
}

事件接口

type IFacade

type IFacade interface {
	GetFacadeAccessor()
}

facade接口

type IHash

type IHash interface {
	Check(string, string, ...string) bool
	Make(string, ...map[string]int) string
}

加密接口

type IMiddleware

type IMiddleware interface {
	Middleware()
}

中间件接口

type IObserver

type IObserver interface {
	Handle(IEvent) bool
}

观察者接口

type IServiceProvider

type IServiceProvider interface {
	Register()
	Boot()
}

每个服务需实现该接口

type ISubject

type ISubject interface {
	Attach(string, reflect.Value)
	Detach(string, string)
	Fire(IEvent)
}

被观察者接口

type IUser

type IUser interface {
	Get(string) interface{}
	GetAuthIdentifierName() string
	GetAuthIdentifier() string
	GetAuthPassword() string
	GetRememberToken() string
	SetRememberToken(interface{})
	GetRememberTokenName() string
	SetApiToken(interface{})
	GetApiToken() string
	GetApiTokenName() string
	IsEmpty() bool
}

用户接口

type IUserProvider

type IUserProvider interface {
	RetrieveById(string) IUser
	RetrieveByToken(string, string) IUser
	UpdateRememberToken(IUser, string)
	UpdateApiToken(IUser, string)
	RetrieveByCredentials(map[string]interface{}) IUser
	ValidateCredentials(IUser, map[string]interface{}) bool
}

用户提供者

type ListenFunc

type ListenFunc func(IEvent) bool

事件监听函数

type ServiceFunc

type ServiceFunc func(IApplication) interface{}

绑定app的函数

Jump to

Keyboard shortcuts

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