Documentation ¶
Index ¶
- func InstallViewHandler(viewManager *view.Manager, server Service, tracerProvider trace.TracerProvider)
- func UnmarshalCommand(raw []byte) (*protos.Command, error)
- type AccessControlChecker
- type Identity
- type IdentityProvider
- type Marshaller
- type Metrics
- type PolicyChecker
- type Processor
- type ResponseMarshaler
- type Server
- func (s *Server) MarshalErrorResponse(command []byte, e error) (*protos2.SignedCommandResponse, error)
- func (s *Server) ProcessCommand(ctx context.Context, sc *protos2.SignedCommand) (cr *protos2.SignedCommandResponse, err error)
- func (s *Server) RegisterProcessor(typ reflect.Type, p Processor)
- func (s *Server) RegisterStreamer(typ reflect.Type, streamer Streamer)
- func (s *Server) StreamCommand(server protos2.ViewService_StreamCommandServer) error
- func (s *Server) ValidateHeader(header *protos2.Header) error
- type Service
- type SignerProvider
- type SigningIdentity
- type Stream
- type Streamer
- type TimeFunc
- type VerifierProvider
- type YesPolicyChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallViewHandler ¶
func InstallViewHandler(viewManager *view.Manager, server Service, tracerProvider trace.TracerProvider)
Types ¶
type AccessControlChecker ¶
type AccessControlChecker struct { IdentityProvider IdentityProvider VerifierProvider VerifierProvider }
func NewAccessControlChecker ¶
func NewAccessControlChecker(identityProvider IdentityProvider, verifierProvider VerifierProvider) *AccessControlChecker
func (*AccessControlChecker) Check ¶
func (a *AccessControlChecker) Check(sc *protos2.SignedCommand, c *protos2.Command) error
type IdentityProvider ¶
type Marshaller ¶
type Marshaller interface {
MarshalCommandResponse(command []byte, responsePayload interface{}) (*protos2.SignedCommandResponse, error)
}
A Marshaller is responsible for marshaling and signing command responses.
type Metrics ¶
func NewMetrics ¶
type PolicyChecker ¶
type PolicyChecker interface {
Check(sc *protos2.SignedCommand, c *protos2.Command) error
}
A PolicyChecker is responsible for performing policy based access control checks related to view commands.
type ResponseMarshaler ¶
type ResponseMarshaler struct {
// contains filtered or unexported fields
}
ResponseMarshaler produces SignedCommandResponse
func NewResponseMarshaler ¶
func NewResponseMarshaler(hasher hash.Hasher, identityProvider IdentityProvider, sigService SignerProvider) (*ResponseMarshaler, error)
func (*ResponseMarshaler) MarshalCommandResponse ¶
func (s *ResponseMarshaler) MarshalCommandResponse(command []byte, responsePayload interface{}) (*protos.SignedCommandResponse, error)
type Server ¶ added in v0.3.0
type Server struct { protos2.UnimplementedViewServiceServer Marshaller Marshaller PolicyChecker PolicyChecker // contains filtered or unexported fields }
Server is responsible for processing view commands.
func NewViewServiceServer ¶
func NewViewServiceServer(marshaller Marshaller, policyChecker PolicyChecker, metrics *Metrics, tracerProvider trace.TracerProvider) (*Server, error)
func (*Server) MarshalErrorResponse ¶ added in v0.3.0
func (*Server) ProcessCommand ¶ added in v0.3.0
func (s *Server) ProcessCommand(ctx context.Context, sc *protos2.SignedCommand) (cr *protos2.SignedCommandResponse, err error)
func (*Server) RegisterProcessor ¶ added in v0.3.0
func (*Server) RegisterStreamer ¶ added in v0.3.0
func (*Server) StreamCommand ¶ added in v0.3.0
func (s *Server) StreamCommand(server protos2.ViewService_StreamCommandServer) error
type Service ¶
type Service interface { protos2.ViewServiceServer RegisterProcessor(typ reflect.Type, p Processor) RegisterStreamer(typ reflect.Type, streamer Streamer) }
func GetService ¶
func GetService(sp view.ServiceProvider) Service
type SignerProvider ¶ added in v0.4.0
type SigningIdentity ¶
SigningIdentity defines the functions necessary to sign an array of bytes; it is needed to sign the commands
type Stream ¶ added in v0.3.0
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) RecvProtoMsg ¶ added in v0.3.0
func (*Stream) SendProtoMsg ¶ added in v0.3.0
type Streamer ¶
type Streamer func(sc *protos2.SignedCommand, command *protos2.Command, commandServer protos2.ViewService_StreamCommandServer, marshaler Marshaller) error
type VerifierProvider ¶
type YesPolicyChecker ¶
type YesPolicyChecker struct { }
func (YesPolicyChecker) Check ¶
func (y YesPolicyChecker) Check(sc *protos2.SignedCommand, c *protos2.Command) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.