Safe Haskell | None |
---|---|
Language | Haskell2010 |
Raft.Types
Synopsis
- type NodeId = ByteString
- type NodeIds = Set NodeId
- newtype ClientId = ClientId NodeId
- newtype LeaderId = LeaderId {
- unLeaderId :: NodeId
- data CurrentLeader
- data Mode
- newtype Term = Term Natural
- intToNatural :: Int -> Either [Char] Natural
- term0 :: Term
- incrTerm :: Term -> Term
- prevTerm :: Term -> Term
- newtype Index = Index Natural
- index0 :: Index
- incrIndex :: Index -> Index
- decrIndexWithDefault0 :: Index -> Index
- newtype SerialNum = SerialNum Natural
Documentation
type NodeId = ByteString Source #
Unique identifier of a Raft node
Unique identifier of a client
Unique identifier of a leader
Constructors
LeaderId | |
Fields
|
data CurrentLeader Source #
Representation of the current leader in the cluster. The system is considered to be unavailable if there is no leader
Constructors
CurrentLeader LeaderId | |
NoLeader |
Instances
Eq CurrentLeader Source # | |
Defined in Raft.Types Methods (==) :: CurrentLeader -> CurrentLeader -> Bool # (/=) :: CurrentLeader -> CurrentLeader -> Bool # | |
Show CurrentLeader Source # | |
Defined in Raft.Types Methods showsPrec :: Int -> CurrentLeader -> ShowS # show :: CurrentLeader -> String # showList :: [CurrentLeader] -> ShowS # | |
Generic CurrentLeader Source # | |
Defined in Raft.Types Associated Types type Rep CurrentLeader :: Type -> Type # | |
Serialize CurrentLeader Source # | |
Defined in Raft.Types | |
type Rep CurrentLeader Source # | |
Defined in Raft.Types type Rep CurrentLeader = D1 (MetaData "CurrentLeader" "Raft.Types" "libraft-0.5.0.0-J9sQlo4v2xjSwCkwompQR" False) (C1 (MetaCons "CurrentLeader" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 LeaderId)) :+: C1 (MetaCons "NoLeader" PrefixI False) (U1 :: Type -> Type)) |
Representation of monotonic election terms
Representation of monotonic indices
Instances
Enum Index Source # | |
Eq Index Source # | |
Integral Index Source # | |
Num Index Source # | |
Ord Index Source # | |
Read Index Source # | |
Real Index Source # | |
Defined in Raft.Types Methods toRational :: Index -> Rational # | |
Show Index Source # | |
Generic Index Source # | |
Serialize Index Source # | |
FromField Index Source # | |
Defined in Raft.Types Methods | |
ToField Index Source # | |
Defined in Raft.Types | |
type Rep Index Source # | |
Defined in Raft.Types |
decrIndexWithDefault0 :: Index -> Index Source #
Decrement index. If the given index is 0, return the given index
Instances
Enum SerialNum Source # | |
Defined in Raft.Types Methods succ :: SerialNum -> SerialNum # pred :: SerialNum -> SerialNum # fromEnum :: SerialNum -> Int # enumFrom :: SerialNum -> [SerialNum] # enumFromThen :: SerialNum -> SerialNum -> [SerialNum] # enumFromTo :: SerialNum -> SerialNum -> [SerialNum] # enumFromThenTo :: SerialNum -> SerialNum -> SerialNum -> [SerialNum] # | |
Eq SerialNum Source # | |
Num SerialNum Source # | |
Ord SerialNum Source # | |
Read SerialNum Source # | |
Show SerialNum Source # | |
Generic SerialNum Source # | |
Serialize SerialNum Source # | |
type Rep SerialNum Source # | |
Defined in Raft.Types |