lcache

package
v0.0.0-...-6ed4abe Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package lcache provides a cache library for storing and retrieving data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the instance of the app cache.

func (*App) BatchUpdateLastConsumedTime

func (ap *App) BatchUpdateLastConsumedTime(kt *kit.Kit, bizID uint32, appIDs []uint32) error

BatchUpdateLastConsumedTime 批量更新服务拉取时间

func (*App) GetAppID

func (ap *App) GetAppID(kt *kit.Kit, bizID uint32, appName string) (uint32, error)

GetAppID get app id by app name.

func (*App) GetMeta

func (ap *App) GetMeta(kt *kit.Kit, bizID uint32, appID uint32) (*types.AppCacheMeta, error)

GetMeta the app meta cache.

func (*App) IsAppExist

func (ap *App) IsAppExist(kt *kit.Kit, bizID uint32, appIDs ...uint32) (bool, error)

IsAppExist validate app if exist.

func (*App) ListApps

func (ap *App) ListApps(kt *kit.Kit, req *pbcs.ListAppsReq) (*pbcs.ListAppsResp, error)

ListApps 获取App列表, 不缓存,直接透传请求

func (*App) RemoveCache

func (ap *App) RemoveCache(kt *kit.Kit, bizID uint32, appName string)

RemoveCache 清空app缓存

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

Auth is the instance of the auth cache.

func (*Auth) Authorize

func (au *Auth) Authorize(kt *kit.Kit, res *meta.ResourceAttribute) (bool, error)

Authorize if user has permission to the bscp resource.

type Cache

type Cache struct {
	App           *App
	ReleasedCI    *ReleasedCI
	ReleasedKv    *ReleasedKv
	ReleasedGroup *ReleasedGroup
	Credential    *Credential
	ReleasedHook  *ReleasedHook
	Auth          *Auth
	ClientMetric  *ClientMetric
}

Cache defines a cache instance.

func NewLocalCache

func NewLocalCache(cs *clientset.ClientSet) (*Cache, error)

NewLocalCache initial the cache instance.

func (*Cache) Purge

func (c *Cache) Purge(kt *kit.Kit, es []*types.EventMeta)

Purge is used to clean the resource's cache with events.

type ClientMetric

type ClientMetric struct {
	// contains filtered or unexported fields
}

ClientMetric xxx

func (*ClientMetric) Set

func (cm *ClientMetric) Set(kt *kit.Kit, bizID, appID uint32, payload []byte) error

Set tore client metric data into redis queues

type Credential

type Credential struct {
	// contains filtered or unexported fields
}

Credential is the instance of the credential local cache.

func (*Credential) CanMatchCI

func (s *Credential) CanMatchCI(kt *kit.Kit, bizID uint32, app string, credential string,
	path string, name string) (bool, error)

CanMatchCI the credential's local cache. CanMatchCI 支持文件类型和KV类型

func (*Credential) GetCred

func (s *Credential) GetCred(kt *kit.Kit, bizID uint32, credential string) (*types.CredentialCache, error)

GetCred 获取凭证, 并缓存

type ReleasedCI

type ReleasedCI struct {
	// contains filtered or unexported fields
}

ReleasedCI is the instance of the released ci cache.

func (*ReleasedCI) Get

func (ci *ReleasedCI) Get(kt *kit.Kit, bizID uint32, releaseID uint32) ([]*types.ReleaseCICache, error)

Get the released config item's cache.

type ReleasedGroup

type ReleasedGroup struct {
	// contains filtered or unexported fields
}

ReleasedGroup is the instance of the ReleasedGroup local cache.

func (*ReleasedGroup) Get

func (s *ReleasedGroup) Get(kt *kit.Kit, bizID uint32, appID uint32) (
	[]*types.ReleasedGroupCache, error)

Get the released group's local cache.

type ReleasedHook

type ReleasedHook struct {
	// contains filtered or unexported fields
}

ReleasedHook is the instance of the released hook cache.

func (*ReleasedHook) Get

func (r *ReleasedHook) Get(kt *kit.Kit, bizID uint32, releaseID uint32) (
	*types.ReleasedHookCache, *types.ReleasedHookCache, error)

Get the released hook's cache.

type ReleasedKv

type ReleasedKv struct {
	// contains filtered or unexported fields
}

ReleasedKv is the instance of the released kv cache.

func (*ReleasedKv) Get

func (kv *ReleasedKv) Get(kt *kit.Kit, bizID uint32, releaseID uint32) ([]*types.ReleaseKvCache, error)

Get the released kvs cache.

func (*ReleasedKv) GetKvValue

func (kv *ReleasedKv) GetKvValue(kt *kit.Kit, bizID, appID, releaseID uint32, key string) (*types.ReleaseKvValueCache,
	error)

GetKvValue Get the rkv value cache.

Jump to

Keyboard shortcuts

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