Documentation
¶
Index ¶
- Constants
- func GetLeader() string
- func GetState() raft.RaftState
- func IsLeader() bool
- func Monitor()
- type ConsensusService
- type Store
- func (store *Store) Join(addr string) error
- func (store *Store) Open(peerNodes []string) error
- func (store *Store) RecentAppsMap() (result map[string](*base.RecentApp))
- func (store *Store) ThrottleApp(appName string, expireAt time.Time, ratio float64) error
- func (store *Store) ThrottledAppsMap() (result map[string](*base.AppThrottle))
- func (store *Store) UnthrottleApp(appName string) error
Constants ¶
const RaftDBFile = "freno-raft.db"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsensusService ¶
type ConsensusService interface {
ThrottleApp(appName string, expireAt time.Time, ratio float64) error
ThrottledAppsMap() (result map[string](*base.AppThrottle))
UnthrottleApp(appName string) error
RecentAppsMap() (result map[string](*base.RecentApp))
}
ConsensusService is a freno-oriented interface for making requests that require consensus.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
The store is a raft store that is freno-aware. It operates on a `throttler` instance on given events/commands. Store implements consensusService, which is a freno-oriented interface for running operations via consensus.
func (*Store) Join ¶
Join joins a node, located at addr, to this store. The node must be ready to respond to Raft communications at that address.
func (*Store) Open ¶
Open opens the store. If enableSingle is set, and there are no existing peers, then this node becomes the first node, and therefore leader, of the cluster.
func (*Store) RecentAppsMap ¶
func (*Store) ThrottleApp ¶
ThrottleApp, as implied by consensusService, is a raft oepration request which will ask for consensus.
func (*Store) ThrottledAppsMap ¶
func (store *Store) ThrottledAppsMap() (result map[string](*base.AppThrottle))
func (*Store) UnthrottleApp ¶
UnthrottleApp, as implied by consensusService, is a raft oepration request which will ask for consensus.