monitorserver

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package monitorserver contains an implementation of a Monitor server which can be queried for monitoring results.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNothingProcessed occurs when the monitor did not process any mutations /
	// smrs yet.
	ErrNothingProcessed = errors.New("did not process any mutations yet")
)

Functions

This section is empty.

Types

type Server

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

Server holds internal state for the monitor server. It serves monitoring responses via a grpc and HTTP API.

func New

func New(storage monitorstorage.Interface) *Server

New creates a new instance of the monitor server.

func (*Server) GetState

func (s *Server) GetState(ctx context.Context, in *pb.GetStateRequest) (*pb.State, error)

GetState returns the latest valid signed map root the monitor observed. Additionally, the response contains additional data necessary to reproduce errors on failure.

Returns the signed map root for the latest revision the monitor observed. If the monitor could not reconstruct the map root given the set of mutations from the previous to the current revision it won't sign the map root and additional data will be provided to reproduce the failure.

func (*Server) GetStateByRevision

func (s *Server) GetStateByRevision(ctx context.Context, in *pb.GetStateRequest) (*pb.State, error)

GetStateByRevision works similar to GetSignedMapRoot but returns the monitor's result for a specific map revision.

Returns the signed map root for the specified revision the monitor observed. If the monitor could not reconstruct the map root given the set of mutations from the previous to the current revision it won't sign the map root and additional data will be provided to reproduce the failure.

Source Files

Jump to

Keyboard shortcuts

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