Documentation ¶
Index ¶
- Constants
- Variables
- type AuthProxy
- type Cluster
- func (c *Cluster) AddCaps(id string, keyInfo *keystore.KeyInfo) (res *keystore.KeyInfo, err error)
- func (c *Cluster) CreateNewKey(id string, keyInfo *keystore.KeyInfo) (res *keystore.KeyInfo, err error)
- func (c *Cluster) DeleteCaps(id string, keyInfo *keystore.KeyInfo) (res *keystore.KeyInfo, err error)
- func (c *Cluster) DeleteKey(id string) (res *keystore.KeyInfo, err error)
- func (c *Cluster) GetAKInfo(accessKey string) (akInfo *keystore.AccessKeyInfo, err error)
- func (c *Cluster) GetKey(id string) (res *keystore.KeyInfo, err error)
- type KeystoreFsm
- func (mf *KeystoreFsm) Apply(command []byte, index uint64) (resp interface{}, err error)
- func (mf *KeystoreFsm) ApplyMemberChange(confChange *proto.ConfChange, index uint64) (interface{}, error)
- func (mf *KeystoreFsm) ApplySnapshot(peers []proto.Peer, iterator proto.SnapIterator) (err error)
- func (mf *KeystoreFsm) Del(key interface{}) (interface{}, error)
- func (mf *KeystoreFsm) DeleteAKInfo(accessKey string)
- func (mf *KeystoreFsm) DeleteKey(id string)
- func (mf *KeystoreFsm) Get(key interface{}) (interface{}, error)
- func (mf *KeystoreFsm) GetAKInfo(accessKey string) (akInfo *keystore.AccessKeyInfo, err error)
- func (mf *KeystoreFsm) GetKey(id string) (u *keystore.KeyInfo, err error)
- func (mf *KeystoreFsm) HandleFatalEvent(err *raft.FatalError)
- func (mf *KeystoreFsm) HandleLeaderChange(leader uint64)
- func (mf *KeystoreFsm) Put(key, val interface{}) (interface{}, error)
- func (mf *KeystoreFsm) PutAKInfo(akInfo *keystore.AccessKeyInfo)
- func (mf *KeystoreFsm) PutKey(k *keystore.KeyInfo)
- func (mf *KeystoreFsm) Snapshot() (proto.Snapshot, error)
- type KeystoreSnapshot
- type LeaderInfo
- type PKIKey
- type RaftCmd
- type Server
Constants ¶
const ( LRUCacheSize = 3 << 30 WriteBufferSize = 4 * util.MB )
const ( ClusterName = "clusterName" ID = "id" IP = "ip" Port = "port" LogLevel = "logLevel" WalDir = "walDir" StoreDir = "storeDir" GroupID = 1 ModuleName = "authnode" CfgRetainLogs = "retainLogs" DefaultRetainLogs = 20000 AuthSecretKey = "authServiceKey" AuthRootKey = "authRootKey" EnableHTTPS = "enableHTTPS" )
configuration keys
const (
AuthService = "AuthService"
)
Keys in the request
Variables ¶
var AddrDatabase = make(map[uint64]string)
AddrDatabase is a map that stores the address of a given host (e.g., the leader)
Functions ¶
This section is empty.
Types ¶
type AuthProxy ¶
type AuthProxy struct {
// contains filtered or unexported fields
}
AuthProxy wraps the stuff for http and https
type Cluster ¶
type Cluster struct { Name string DisableAutoAllocate bool AuthSecretKey []byte AuthRootKey []byte PKIKey PKIKey // contains filtered or unexported fields }
Cluster stores all the cluster-level information.
func (*Cluster) CreateNewKey ¶
func (c *Cluster) CreateNewKey(id string, keyInfo *keystore.KeyInfo) (res *keystore.KeyInfo, err error)
CreateNewKey create a new key to the keystore
func (*Cluster) DeleteCaps ¶
func (c *Cluster) DeleteCaps(id string, keyInfo *keystore.KeyInfo) (res *keystore.KeyInfo, err error)
DeleteCaps delete caps from the key
type KeystoreFsm ¶
type KeystoreFsm struct {
// contains filtered or unexported fields
}
KeystoreFsm represents the finite state machine of a keystore
func (*KeystoreFsm) Apply ¶
func (mf *KeystoreFsm) Apply(command []byte, index uint64) (resp interface{}, err error)
Apply implements the interface of raft.StateMachine
func (*KeystoreFsm) ApplyMemberChange ¶
func (mf *KeystoreFsm) ApplyMemberChange(confChange *proto.ConfChange, index uint64) (interface{}, error)
ApplyMemberChange implements the interface of raft.StateMachine
func (*KeystoreFsm) ApplySnapshot ¶
func (mf *KeystoreFsm) ApplySnapshot(peers []proto.Peer, iterator proto.SnapIterator) (err error)
ApplySnapshot implements the interface of raft.StateMachine
func (*KeystoreFsm) Del ¶
func (mf *KeystoreFsm) Del(key interface{}) (interface{}, error)
Del implements the interface of raft.StateMachine
func (*KeystoreFsm) DeleteAKInfo ¶
func (mf *KeystoreFsm) DeleteAKInfo(accessKey string)
func (*KeystoreFsm) DeleteKey ¶
func (mf *KeystoreFsm) DeleteKey(id string)
DeleteKey Delete keyInfo in keystore cache
func (*KeystoreFsm) Get ¶
func (mf *KeystoreFsm) Get(key interface{}) (interface{}, error)
Get implements the interface of raft.StateMachine
func (*KeystoreFsm) GetAKInfo ¶
func (mf *KeystoreFsm) GetAKInfo(accessKey string) (akInfo *keystore.AccessKeyInfo, err error)
func (*KeystoreFsm) GetKey ¶
func (mf *KeystoreFsm) GetKey(id string) (u *keystore.KeyInfo, err error)
GetKey Get keyInfo from keystore cache
func (*KeystoreFsm) HandleFatalEvent ¶
func (mf *KeystoreFsm) HandleFatalEvent(err *raft.FatalError)
HandleFatalEvent implements the interface of raft.StateMachine
func (*KeystoreFsm) HandleLeaderChange ¶
func (mf *KeystoreFsm) HandleLeaderChange(leader uint64)
HandleLeaderChange implements the interface of raft.StateMachine
func (*KeystoreFsm) Put ¶
func (mf *KeystoreFsm) Put(key, val interface{}) (interface{}, error)
Put implements the interface of raft.StateMachine
func (*KeystoreFsm) PutAKInfo ¶
func (mf *KeystoreFsm) PutAKInfo(akInfo *keystore.AccessKeyInfo)
func (*KeystoreFsm) PutKey ¶
func (mf *KeystoreFsm) PutKey(k *keystore.KeyInfo)
PutKey change keyInfo in keystore cache
type KeystoreSnapshot ¶
type KeystoreSnapshot struct {
// contains filtered or unexported fields
}
KeystoreSnapshot represents the snapshot of a keystore partition
func (*KeystoreSnapshot) ApplyIndex ¶
func (ms *KeystoreSnapshot) ApplyIndex() uint64
ApplyIndex implements the Snapshot interface
func (*KeystoreSnapshot) Close ¶
func (ms *KeystoreSnapshot) Close()
Close implements the Snapshot interface
func (*KeystoreSnapshot) Next ¶
func (ms *KeystoreSnapshot) Next() (data []byte, err error)
Next implements the Snapshot interface
type LeaderInfo ¶
type LeaderInfo struct {
// contains filtered or unexported fields
}
LeaderInfo represents the leader's information
type RaftCmd ¶
RaftCmd defines the Raft commands.