base

package
v0.0.0-...-46131a5 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlarmDisarm

func AlarmDisarm(m *clientv3.AlarmMember) error

AlarmDisarm 解除警报

func AlarmList

func AlarmList() error

AlarmList 获取警报列表

func AuthDisable

func AuthDisable() error

AuthDisable 关闭鉴权

func AuthEnable

func AuthEnable() error

AuthEnable 启动鉴权

func AuthStatus

func AuthStatus() error

AuthStatus 获取鉴权开启状态

func Delete

func Delete(key string, opts ...clientv3.OpOption) error

Delete 删除键值对

func Get

func Get(key string, opts ...clientv3.OpOption) error

Get 获取值

func HashKV

func HashKV() error

HashKV 查看节点历史hash

func LeaseGrant

func LeaseGrant(ttl int64) error

LeaseGrant 生成租约

func LeaseKeepAlive

func LeaseKeepAlive(id int64) error

LeaseKeepAlive 保持租约不过期

func LeaseKeepAliveOnce

func LeaseKeepAliveOnce(id int64) error

LeaseKeepAliveOnce 更新租约一次

func LeaseList

func LeaseList() error

LeaseList 获取租约列表

func LeaseRevoke

func LeaseRevoke(id int64) error

LeaseRevoke 撤销租约

func LeaseTimeToLive

func LeaseTimeToLive(id int64, opts ...clientv3.LeaseOption) error

LeaseTimeToLive 租约信息

func MemberAdd

func MemberAdd(peerAddrs []string) error

MemberAdd 添加常规节点

func MemberAddLearner

func MemberAddLearner(peerAddrs []string) error

MemberAddLearner 添加学习者节点

func MemberList

func MemberList() error

MemberList 节点列表

func MemberPromote

func MemberPromote(id uint64) error

MemberPromote 提升学习者节点为常规节点

func MemberRemove

func MemberRemove(id uint64) error

MemberRemove 删除成员

func MemberUpdate

func MemberUpdate(id uint64, peerAddrs []string) error

MemberUpdate 成员更新

func MoveLeader

func MoveLeader(id uint64) error

MoveLeader 提升为leader

func Mutex

func Mutex(ttl int64, pfx string) (*concurrency.Mutex, error)

Mutex 分布式锁

func Put

func Put(key, val string, opts ...clientv3.OpOption) error

Put 设置值

func RoleAdd

func RoleAdd(role string) error

RoleAdd 添加角色

func RoleDelete

func RoleDelete(role string) error

RoleDelete 删除角色

func RoleGet

func RoleGet(role string) error

RoleGet 获取角色信息

func RoleGrantPermission

func RoleGrantPermission(role string, key, rangeEnd string, permType clientv3.PermissionType) error

RoleGrantPermission 赋予角色权限

func RoleList

func RoleList() error

RoleList 获取角色列表

func RoleRevokePermission

func RoleRevokePermission(role string, key, rangeEnd string) error

RoleRevokePermission 撤销角色权限

func SnapshotSave

func SnapshotSave(cfg clientv3.Config, dbPath string) error

SnapshotSave 生成快照

func Status

func Status() error

Status 查看状态

func Txn

func Txn(cmp []clientv3.Cmp, success []clientv3.Op, fail []clientv3.Op) error

Txn 事务

func UserAdd

func UserAdd(name, password string) error

UserAdd 添加用户

func UserAddWithOptions

func UserAddWithOptions(name, password string, options *clientv3.UserAddOptions) error

UserAddWithOptions 使用选项添加用户

func UserChangePasswd

func UserChangePasswd(name, password string) error

UserChangePasswd 修改密码

func UserDelete

func UserDelete(name string) error

UserDelete 删除用户

func UserGet

func UserGet(name string) error

UserGet 获取用户信息

func UserGrantRole

func UserGrantRole(name, role string) error

UserGrantRole 赋予用户角色

func UserList

func UserList() error

UserList 获取用户列表

func UserRevokeRole

func UserRevokeRole(name, role string) error

UserRevokeRole 撤销用户角色

func Watch

func Watch(key string, opts ...clientv3.OpOption)

Watch 监听

Types

This section is empty.

Jump to

Keyboard shortcuts

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