Documentation ¶
Index ¶
- func ConvertRaftAddressToHTTPAddress(raftAddress string) (string, error)
- func DoJoinNodeRequest(clusterAddress string, nodeID string, nodeAddress string, ...) error
- type Service
- func (s *Service) Addr() string
- func (s *Service) DoAddPolicyRequest(request *command.AddPoliciesRequest) error
- func (s *Service) DoClearPolicyRequest() error
- func (s *Service) DoJoinNodeRequest(request *command.AddNodeRequest) error
- func (s *Service) DoRemoveFilteredPolicyRequest(request *command.RemoveFilteredPolicyRequest) error
- func (s *Service) DoRemoveNodeRequest(request *command.RemoveNodeRequest) error
- func (s *Service) DoRemovePolicyRequest(request *command.RemovePoliciesRequest) error
- func (s *Service) DoUpdatePoliciesRequest(request *command.UpdatePoliciesRequest) error
- func (s *Service) DoUpdatePolicyRequest(request *command.UpdatePolicyRequest) error
- func (s *Service) Start() error
- func (s *Service) Stop(ctx context.Context) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service setups a HTTP service for forward data of raft node.
func NewService ¶
NewService creates a Service.
func (*Service) DoAddPolicyRequest ¶
func (s *Service) DoAddPolicyRequest(request *command.AddPoliciesRequest) error
func (*Service) DoClearPolicyRequest ¶
func (*Service) DoJoinNodeRequest ¶
func (s *Service) DoJoinNodeRequest(request *command.AddNodeRequest) error
func (*Service) DoRemoveFilteredPolicyRequest ¶
func (s *Service) DoRemoveFilteredPolicyRequest(request *command.RemoveFilteredPolicyRequest) error
func (*Service) DoRemoveNodeRequest ¶
func (s *Service) DoRemoveNodeRequest(request *command.RemoveNodeRequest) error
func (*Service) DoRemovePolicyRequest ¶
func (s *Service) DoRemovePolicyRequest(request *command.RemovePoliciesRequest) error
func (*Service) DoUpdatePoliciesRequest ¶
func (s *Service) DoUpdatePoliciesRequest(request *command.UpdatePoliciesRequest) error
func (*Service) DoUpdatePolicyRequest ¶
func (s *Service) DoUpdatePolicyRequest(request *command.UpdatePolicyRequest) error
type Store ¶
type Store interface { // AddPolicies adds a set of rules to the current policy. AddPolicies(request *command.AddPoliciesRequest) error // RemovePolicies removes a set of rules from the current policy. RemovePolicies(request *command.RemovePoliciesRequest) error // RemoveFilteredPolicy removes a set of rules that match a pattern from the current policy. RemoveFilteredPolicy(request *command.RemoveFilteredPolicyRequest) error // UpdatePolicy updates a rule of policy. UpdatePolicy(request *command.UpdatePolicyRequest) error // UpdatePolicies updates a set of rules of policy. UpdatePolicies(request *command.UpdatePoliciesRequest) error // ClearPolicy clears all policies. ClearPolicy() error // JoinNode joins a node with a given serverID and network address to cluster. JoinNode(serverID string, address string) error // RemoveNode removes a node with a given serverID from cluster. RemoveNode(serverID string) error // Leader checks if it is a leader and returns network address. Leader() (bool, string) }
Store provides an interface that can be implemented by raft.
Click to show internal directories.
Click to hide internal directories.