Documentation ¶
Index ¶
- func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error
- type Option
- type Server
- func (s *Server) GetPolicy(_ context.Context, req *control.GetPolicyRequest) (*control.GetPolicyResponse, error)
- func (s *Server) HealthCheck(_ context.Context, req *control.HealthCheckRequest) (*control.HealthCheckResponse, error)
- func (s *Server) ListPolicies(_ context.Context, req *control.ListPoliciesRequest) (*control.ListPoliciesResponse, error)
- func (s *Server) PutPolicies(_ context.Context, req *control.PutPoliciesRequest) (*control.PutPoliciesResponse, error)
- func (s *Server) RemovePolicies(_ context.Context, req *control.RemovePoliciesRequest) (*control.RemovePoliciesResponse, error)
- type Settings
- type SignedMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignMessage ¶
func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error
SignMessage signs Control service message with private key.
Types ¶
type Option ¶
type Option func(*cfg)
Option of the Server's constructor.
func WithChainStorage ¶
func WithChainStorage(chainStorage engine.LocalOverrideStorage) Option
WithChainStorage returns option to set logger.
func WithSettings ¶
WithSettings returns option to add settings to use Control service.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetPolicy ¶
func (s *Server) GetPolicy(_ context.Context, req *control.GetPolicyRequest) (*control.GetPolicyResponse, error)
GetPolicy returns existing policy.
If request is unsigned or signed by disallowed key, permission error returns.
func (*Server) HealthCheck ¶
func (s *Server) HealthCheck(_ context.Context, req *control.HealthCheckRequest) (*control.HealthCheckResponse, error)
HealthCheck returns health status of the local node.
If request is unsigned or signed by disallowed key, permission error returns.
func (*Server) ListPolicies ¶
func (s *Server) ListPolicies(_ context.Context, req *control.ListPoliciesRequest) (*control.ListPoliciesResponse, error)
ListPolicies lists existing policies.
If request is unsigned or signed by disallowed key, permission error returns.
func (*Server) PutPolicies ¶
func (s *Server) PutPolicies(_ context.Context, req *control.PutPoliciesRequest) (*control.PutPoliciesResponse, error)
PutPolicies replaces existing policies.
If request is unsigned or signed by disallowed key, permission error returns.
func (*Server) RemovePolicies ¶
func (s *Server) RemovePolicies(_ context.Context, req *control.RemovePoliciesRequest) (*control.RemovePoliciesResponse, error)
RemovePolicies removes existing policies.
If request is unsigned or signed by disallowed key, permission error returns.