monitor_go_proto

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: 19 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

View Source
var File_monitor_v1_monitor_proto protoreflect.FileDescriptor

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 RegisterMonitorHandlerServer added in v0.3.0

func RegisterMonitorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MonitorServer) error

RegisterMonitorHandlerServer registers the http handlers for service Monitor to "mux". UnaryRPC :call MonitorServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

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"`
	// contains filtered or unexported fields
}

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

func (*GetStateRequest) Descriptor deprecated

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

Deprecated: Use GetStateRequest.ProtoReflect.Descriptor instead.

func (*GetStateRequest) GetDirectoryId

func (x *GetStateRequest) GetDirectoryId() string

func (*GetStateRequest) GetKtUrl

func (x *GetStateRequest) GetKtUrl() string

func (*GetStateRequest) GetRevision

func (x *GetStateRequest) GetRevision() int64

func (*GetStateRequest) ProtoMessage

func (*GetStateRequest) ProtoMessage()

func (*GetStateRequest) ProtoReflect added in v0.3.0

func (x *GetStateRequest) ProtoReflect() protoreflect.Message

func (*GetStateRequest) Reset

func (x *GetStateRequest) Reset()

func (*GetStateRequest) String

func (x *GetStateRequest) String() string

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.ClientConnInterface) 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"`
	// contains filtered or unexported fields
}

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

func (*State) Descriptor deprecated

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

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetErrors

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

func (*State) GetSeenTime

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

func (*State) GetSmr

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

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect added in v0.3.0

func (x *State) ProtoReflect() protoreflect.Message

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

type UnimplementedMonitorServer

type UnimplementedMonitorServer struct {
}

UnimplementedMonitorServer can be embedded to have forward compatible implementations.

func (*UnimplementedMonitorServer) GetState

func (*UnimplementedMonitorServer) GetStateByRevision

Jump to

Keyboard shortcuts

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