monitor_go_proto

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package monitor_go_proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMonitorHandler

func RegisterMonitorHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMonitorHandler registers the http handlers for service Monitor to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMonitorHandlerClient

func RegisterMonitorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MonitorClient) error

RegisterMonitorHandlerClient registers the http handlers for service Monitor to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MonitorClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MonitorClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MonitorClient" to call the correct interceptors.

func RegisterMonitorHandlerFromEndpoint

func RegisterMonitorHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMonitorHandlerFromEndpoint is same as RegisterMonitorHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMonitorServer

func RegisterMonitorServer(s *grpc.Server, srv MonitorServer)

Types

type GetStateRequest

type GetStateRequest struct {
	// kt_url is the URL of the keytransparency server for which the monitoring
	// result will be returned.
	KtUrl string `protobuf:"bytes,2,opt,name=kt_url,json=ktUrl,proto3" json:"kt_url,omitempty"`
	// directory_id identifies the merkle tree being monitored.
	DirectoryId string `protobuf:"bytes,3,opt,name=directory_id,json=directoryId,proto3" json:"directory_id,omitempty"`
	// revision specifies the revision for which the monitoring results will
	// be returned (revisions start at 0).
	Revision             int64    `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

GetStateRequest requests the verification state of a keytransparency directory for a particular point in time.

func (*GetStateRequest) Descriptor

func (*GetStateRequest) Descriptor() ([]byte, []int)

func (*GetStateRequest) GetDirectoryId

func (m *GetStateRequest) GetDirectoryId() string

func (*GetStateRequest) GetKtUrl

func (m *GetStateRequest) GetKtUrl() string

func (*GetStateRequest) GetRevision

func (m *GetStateRequest) GetRevision() int64

func (*GetStateRequest) ProtoMessage

func (*GetStateRequest) ProtoMessage()

func (*GetStateRequest) Reset

func (m *GetStateRequest) Reset()

func (*GetStateRequest) String

func (m *GetStateRequest) String() string

func (*GetStateRequest) XXX_DiscardUnknown

func (m *GetStateRequest) XXX_DiscardUnknown()

func (*GetStateRequest) XXX_Marshal

func (m *GetStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetStateRequest) XXX_Merge

func (m *GetStateRequest) XXX_Merge(src proto.Message)

func (*GetStateRequest) XXX_Size

func (m *GetStateRequest) XXX_Size() int

func (*GetStateRequest) XXX_Unmarshal

func (m *GetStateRequest) XXX_Unmarshal(b []byte) error

type MonitorClient

type MonitorClient interface {
	// GetSignedMapRoot returns the latest valid signed map root the monitor
	// observed. Additionally, the response contains extra 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.
	GetState(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*State, error)
	// GetSignedMapRootByRevision 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.
	GetStateByRevision(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*State, error)
}

MonitorClient is the client API for Monitor service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMonitorClient

func NewMonitorClient(cc *grpc.ClientConn) MonitorClient

type MonitorServer

type MonitorServer interface {
	// GetSignedMapRoot returns the latest valid signed map root the monitor
	// observed. Additionally, the response contains extra 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.
	GetState(context.Context, *GetStateRequest) (*State, error)
	// GetSignedMapRootByRevision 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.
	GetStateByRevision(context.Context, *GetStateRequest) (*State, error)
}

MonitorServer is the server API for Monitor service.

type State

type State struct {
	// smr contains the map root for the sparse Merkle Tree signed with the
	// monitor's key on success. If the checks were not successful the
	// smr will be empty. The revisions are encoded into the smr map_revision.
	Smr *trillian.SignedMapRoot `protobuf:"bytes,1,opt,name=smr,proto3" json:"smr,omitempty"`
	// seen_time contains the time when this particular signed map root was
	// retrieved and processed.
	SeenTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=seen_time,json=seenTime,proto3" json:"seen_time,omitempty"`
	// errors contains a list of errors representing the verification checks
	// that failed while monitoring the key-transparency server.
	Errors               []*status.Status `protobuf:"bytes,3,rep,name=errors,proto3" json:"errors,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

State represents the monitor's evaluation of a Key Transparency directory at a particular revision.

func (*State) Descriptor

func (*State) Descriptor() ([]byte, []int)

func (*State) GetErrors

func (m *State) GetErrors() []*status.Status

func (*State) GetSeenTime

func (m *State) GetSeenTime() *timestamp.Timestamp

func (*State) GetSmr

func (m *State) GetSmr() *trillian.SignedMapRoot

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) Reset

func (m *State) Reset()

func (*State) String

func (m *State) String() string

func (*State) XXX_DiscardUnknown

func (m *State) XXX_DiscardUnknown()

func (*State) XXX_Marshal

func (m *State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*State) XXX_Merge

func (m *State) XXX_Merge(src proto.Message)

func (*State) XXX_Size

func (m *State) XXX_Size() int

func (*State) XXX_Unmarshal

func (m *State) XXX_Unmarshal(b []byte) error

type UnimplementedMonitorServer

type UnimplementedMonitorServer struct {
}

UnimplementedMonitorServer can be embedded to have forward compatible implementations.

func (*UnimplementedMonitorServer) GetState

func (*UnimplementedMonitorServer) GetStateByRevision

func (*UnimplementedMonitorServer) GetStateByRevision(ctx context.Context, req *GetStateRequest) (*State, error)

Jump to

Keyboard shortcuts

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