server

package
v0.29.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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 WithLogger

func WithLogger(log *zap.Logger) Option

WithLogger returns option to set logger.

func WithSettings

func WithSettings(settings Settings) Option

WithSettings returns option to add settings to use Control service.

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Server

New creates, initializes and returns new Server instance.

func (*Server) GetPolicy

GetPolicy returns existing policy.

If request is unsigned or signed by disallowed key, permission error returns.

func (*Server) HealthCheck

HealthCheck returns health status of the local node.

If request is unsigned or signed by disallowed key, permission error returns.

func (*Server) ListPolicies

ListPolicies lists existing policies.

If request is unsigned or signed by disallowed key, permission error returns.

func (*Server) PutPolicies

PutPolicies replaces existing policies.

If request is unsigned or signed by disallowed key, permission error returns.

func (*Server) RemovePolicies

RemovePolicies removes existing policies.

If request is unsigned or signed by disallowed key, permission error returns.

type Settings

type Settings interface {
	ResolveNamespaceAlias(ns string) string
	FetchRawKeys() [][]byte
}

type SignedMessage

type SignedMessage interface {
	ReadSignedData([]byte) ([]byte, error)
	GetSignature() *control.Signature
	SetSignature(*control.Signature)
}

SignedMessage is an interface of Control service message.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL