Documentation ¶
Index ¶
- type AlphaRPCsCache
- type BFTRaftClient
- func (brc *BFTRaftClient) ExecCommand(groupId uint64, funcId uint64, arg []byte) (*[]byte, error)
- func (brc *BFTRaftClient) GetGroupHosts(groupId uint64) *[]*spb.Host
- func (brc *BFTRaftClient) GetGroupLeader(groupId uint64) spb.BFTRaftClient
- func (brc *BFTRaftClient) GroupExists(groupId uint64) bool
- type ClientOptions
- type FeedbackServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlphaRPCsCache ¶
type AlphaRPCsCache struct {
// contains filtered or unexported fields
}
func NewAlphaRPCsCache ¶
func NewAlphaRPCsCache(bootstraps []string) AlphaRPCsCache
func (*AlphaRPCsCache) Get ¶
func (arc *AlphaRPCsCache) Get() []*spb.BFTRaftClient
func (*AlphaRPCsCache) ResetBootstrap ¶
func (arc *AlphaRPCsCache) ResetBootstrap(addrs []string)
type BFTRaftClient ¶
type BFTRaftClient struct { Id uint64 PrivateKey *rsa.PrivateKey AlphaRPCs AlphaRPCsCache GroupHosts *cache.Cache GroupLeader *cache.Cache CmdResChan map[uint64]map[uint64]chan []byte Counter int64 Lock sync.RWMutex }
func NewClient ¶
func NewClient(bootstraps []string, opts ClientOptions) (*BFTRaftClient, error)
bootstraps is a list of server address believed to be the member of the network the list does not need to contain alpha nodes since all of the nodes on the network will get informed
func (*BFTRaftClient) ExecCommand ¶
func (*BFTRaftClient) GetGroupHosts ¶
func (brc *BFTRaftClient) GetGroupHosts(groupId uint64) *[]*spb.Host
func (*BFTRaftClient) GetGroupLeader ¶
func (brc *BFTRaftClient) GetGroupLeader(groupId uint64) spb.BFTRaftClient
func (*BFTRaftClient) GroupExists ¶
func (brc *BFTRaftClient) GroupExists(groupId uint64) bool
type ClientOptions ¶
type ClientOptions struct {
PrivateKey []byte
}
type FeedbackServer ¶
type FeedbackServer struct {
ClientIns *BFTRaftClient
}
func (*FeedbackServer) ResponseCommand ¶
func (fs *FeedbackServer) ResponseCommand(ctx context.Context, cmd *pb.CommandResult) (*pb.Nothing, error)
Click to show internal directories.
Click to hide internal directories.