Documentation ¶
Index ¶
- 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) DoUpdateFilteredPoliciesRequest(request *command.UpdateFilteredPoliciesRequest) error
- func (s *Service) DoUpdatePoliciesRequest(request *command.UpdatePoliciesRequest) error
- func (s *Service) DoUpdatePolicyRequest(request *command.UpdatePolicyRequest) error
- func (s *Service) GetScheme() string
- 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 ¶
func NewService(logger *zap.Logger, ln net.Listener, tlsConfig *tls.Config, store Store) (*Service, error)
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) DoUpdateFilteredPoliciesRequest ¶ added in v0.0.13
func (s *Service) DoUpdateFilteredPoliciesRequest(request *command.UpdateFilteredPoliciesRequest) 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 // UpdateFilteredPolicies updates a set of rules of policy. UpdateFilteredPolicies(request *command.UpdateFilteredPoliciesRequest) 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) // Stats returns stats. Stats() (map[string]interface{}, error) }
Store provides an interface that can be implemented by raft.
Click to show internal directories.
Click to hide internal directories.