Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSecretNotFound = errors.New("secret not found") // secret 未找到 ErrPolicyNotFound = errors.New("policy not found") // policy 未找到 )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache 用于存储 secrets 和 policies.
func GetCacheInstance ¶
GetCacheInstance 基于指定 store 实例获取 Cache 实例.
func (*Cache) GetPolicy ¶
func (c *Cache) GetPolicy(key string) ([]*ladon.DefaultPolicy, error)
GetPolicy 获取指定用户的 ladon policy 详情.
type Load ¶
type Load struct {
// contains filtered or unexported fields
}
Load 用于重载 secrets 和 policies.
type Notification ¶
type Notification struct { Command NotificationCommand `json:"command"` Payload string `json:"payload"` Signature string `json:"signature"` SignatureAlgo crypto.Hash `json:"algorithm"` }
Notification 是一个用于发布和订阅消息编码类型.
type NotificationCommand ¶
type NotificationCommand string
NotificationCommand 定义一个新的通知类型.
const ( RedisPubSubChannel = "skt.notifications" NoticePolicyChanged NotificationCommand = "PolicyChanged" NoticeSecretChanged NotificationCommand = "SecretChanged" )
定义 Redis 订阅相关键和事件.
Click to show internal directories.
Click to hide internal directories.