Documentation ¶
Index ¶
- Variables
- func AddAccessTokenToCache(accessToken string, m *model.AccessToken)
- func AnalysisAccessToken(accessToken string) (*model.AccessToken, error)
- func DoubleWrite(storeDetectionEventChan chan<- struct{}, exec, execBackup doubleWriteFunc) error
- func FetchLocalStore() []store.LoadAllFunc
- func FetchSvcStores(typ string) []store.HealthFunc
- func GenAccessToken(serverSign string) (accessToken string, m *model.AccessToken, err error)
- func GetAccessTokenInCache(accessToken string) *model.AccessToken
- func Initialize(storeDetectionEventChan chan<- struct{})
- func LoadAllData()
- func MultiStoreDelete(ctx context.Context, storeDetectionEventChan chan<- struct{}, ID int64, ...) error
- func MultiStoreInsert[T any](ctx context.Context, storeDetectionEventChan chan<- struct{}, m T, ...) error
- func MultiStorePaging[P any, R any](ctx context.Context, storeDetectionEventChan chan<- struct{}, p P, ...) (result []R, count int64, err error)
- func MultiStoreSelectByCondition[P any, R any](ctx context.Context, storeDetectionEventChan chan<- struct{}, p P, ...) (result []R, err error)
- func MultiStoreUpdate(ctx context.Context, storeDetectionEventChan chan<- struct{}, ID int64, ...) error
- func ValidCode(ctx context.Context, account, code string) (bool, error)
- func VerifyAccessTokenM(tokenM *model.AccessToken) error
- type SecretSvc
- func (s *SecretSvc) Add(ctx context.Context, account string, isEnable uint8) error
- func (s *SecretSvc) CalcDataCheckSum(isEnable uint8, account, secretSeedCipher string) string
- func (s *SecretSvc) CheckModel(m *model.AccountSecretModel, isDecrypt bool) error
- func (s *SecretSvc) GetByAccount(ctx context.Context, account string, isDecrypt bool) (*model.AccountSecretModel, error)
- func (s *SecretSvc) IsExists(ctx context.Context, account string) (bool, error)
- func (s *SecretSvc) NewSecretModel(account string, isEnable uint8) (*model.AccountSecretModel, error)
- func (s *SecretSvc) Paging(ctx context.Context, p *param.SecretPagingParam) (result []*model.AccountSecretModel, count int64, err error)
- func (s *SecretSvc) SetEnable(ctx context.Context, account string, isEnable uint8) error
- type ServerIpListSvc
- type ServerSvc
- func (s *ServerSvc) Add(ctx context.Context, p *param.ServerParam) error
- func (s *ServerSvc) CalcDataCheckSum(m *model.ServerModel) string
- func (s *ServerSvc) CheckModel(m *model.ServerModel, isDecrypt bool) error
- func (s *ServerSvc) EditBase(ctx context.Context, p *param.ServerParam) error
- func (s *ServerSvc) GetBySign(ctx context.Context, sign string, isDecrypt bool) (*model.ServerModel, error)
- func (s *ServerSvc) IsExists(ctx context.Context, sign string) (bool, error)
- func (s *ServerSvc) NewServerModel(p *param.ServerParam) (*model.ServerModel, error)
- func (s *ServerSvc) Paging(ctx context.Context, p *param.ServerPagingParam) (result []*model.ServerModel, count int64, err error)
- func (s *ServerSvc) SetEnable(ctx context.Context, p *param.ServerParam) error
Constants ¶
This section is empty.
Variables ¶
View Source
var SecretSvcIns = &SecretSvc{}
View Source
var ServerIpListSvcIns = &ServerIpListSvc{}
View Source
var ServerSvcIns = &ServerSvc{}
Functions ¶
func AddAccessTokenToCache ¶
func AddAccessTokenToCache(accessToken string, m *model.AccessToken)
AddAccessTokenToCache 增加access token到缓存
func AnalysisAccessToken ¶
func AnalysisAccessToken(accessToken string) (*model.AccessToken, error)
AnalysisAccessToken 解析access token
func DoubleWrite ¶
func DoubleWrite(storeDetectionEventChan chan<- struct{}, exec, execBackup doubleWriteFunc) error
DoubleWrite 主备写
func FetchLocalStore ¶
func FetchLocalStore() []store.LoadAllFunc
func FetchSvcStores ¶
func FetchSvcStores(typ string) []store.HealthFunc
FetchSvcStores 通过类型获取svc store
func GenAccessToken ¶
func GenAccessToken(serverSign string) (accessToken string, m *model.AccessToken, err error)
GenAccessToken 生成access token serverSign 接入服务的标识 key,iv 系统根密钥,防伪造
func GetAccessTokenInCache ¶
func GetAccessTokenInCache(accessToken string) *model.AccessToken
GetAccessTokenInCache 在缓存中获取access token
func Initialize ¶
func Initialize(storeDetectionEventChan chan<- struct{})
func LoadAllData ¶
func LoadAllData()
func MultiStoreDelete ¶
func MultiStoreInsert ¶
func MultiStoreInsert[T any](ctx context.Context, storeDetectionEventChan chan<- struct{}, m T, stores ...store.InsertFunc[T]) error
MultiStoreInsert 多store insert
func MultiStorePaging ¶
func MultiStoreSelectByCondition ¶
func MultiStoreSelectByCondition[P any, R any](ctx context.Context, storeDetectionEventChan chan<- struct{}, p P, stores ...store.SelectFunc[P, R]) (result []R, err error)
MultiStoreSelectByCondition 多store 条件查询
func MultiStoreUpdate ¶
func VerifyAccessTokenM ¶
func VerifyAccessTokenM(tokenM *model.AccessToken) error
VerifyAccessTokenM 验证access token 验证有效期
Types ¶
type SecretSvc ¶
type SecretSvc struct { Store store.SecretStore // 主存储 StoreBackup store.SecretStore // 备存储 StoreMemory store.SecretStore // 内存存储 // contains filtered or unexported fields }
func (*SecretSvc) CalcDataCheckSum ¶
CalcDataCheckSum 计算数据校验和
func (*SecretSvc) CheckModel ¶
func (s *SecretSvc) CheckModel(m *model.AccountSecretModel, isDecrypt bool) error
CheckModel 校验数据,解密账号密钥密文
func (*SecretSvc) GetByAccount ¶
func (s *SecretSvc) GetByAccount(ctx context.Context, account string, isDecrypt bool) (*model.AccountSecretModel, error)
GetByAccount 通过账号获取密钥信息,密钥已解密 isDecrypt 是否解密账号密钥
func (*SecretSvc) NewSecretModel ¶
func (s *SecretSvc) NewSecretModel(account string, isEnable uint8) (*model.AccountSecretModel, error)
NewSecretModel 创建一个新的账号密钥model
type ServerIpListSvc ¶
type ServerIpListSvc struct { Store store.ServerIpListStore // 主存储 StoreBackup store.ServerIpListStore // 备存储 StoreMemory store.ServerIpListStore // 内存存储 // contains filtered or unexported fields }
func (*ServerIpListSvc) Add ¶
func (s *ServerIpListSvc) Add(ctx context.Context, p *param.ServerIpListParam) error
func (*ServerIpListSvc) GetBySign ¶
func (s *ServerIpListSvc) GetBySign(ctx context.Context, serverSign string) ([]*model.ServerIpListModel, error)
func (*ServerIpListSvc) Remove ¶
func (s *ServerIpListSvc) Remove(ctx context.Context, p *param.ServerIpListParam) error
type ServerSvc ¶
type ServerSvc struct { Store store.ServerStore // 主存储 StoreBackup store.ServerStore // 备存储 StoreMemory store.ServerStore // 内存存储 // contains filtered or unexported fields }
func (*ServerSvc) CalcDataCheckSum ¶
func (s *ServerSvc) CalcDataCheckSum(m *model.ServerModel) string
CalcDataCheckSum 计算数据校验和
func (*ServerSvc) CheckModel ¶
func (s *ServerSvc) CheckModel(m *model.ServerModel, isDecrypt bool) error
CheckModel 校验数据 isDecrypt 解密服务密钥密文和IV密文
func (*ServerSvc) NewServerModel ¶
func (s *ServerSvc) NewServerModel(p *param.ServerParam) (*model.ServerModel, error)
Click to show internal directories.
Click to hide internal directories.