pb

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSynchronizerHandler

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

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

func RegisterSynchronizerHandlerClient

func RegisterSynchronizerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SynchronizerClient) error

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

func RegisterSynchronizerHandlerFromEndpoint

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

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

func RegisterSynchronizerServer

func RegisterSynchronizerServer(s *grpc.Server, srv SynchronizerServer)

Types

type EvaluateProposalsRequest

type EvaluateProposalsRequest struct {
	// List of proposals to evaluate in the current synchronization cycle.
	Matches []*pb.Match `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty"`
	// Identifier for this request issued during request registration.
	Id                   string   `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*EvaluateProposalsRequest) Descriptor

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

func (*EvaluateProposalsRequest) GetId

func (m *EvaluateProposalsRequest) GetId() string

func (*EvaluateProposalsRequest) GetMatches

func (m *EvaluateProposalsRequest) GetMatches() []*pb.Match

func (*EvaluateProposalsRequest) ProtoMessage

func (*EvaluateProposalsRequest) ProtoMessage()

func (*EvaluateProposalsRequest) Reset

func (m *EvaluateProposalsRequest) Reset()

func (*EvaluateProposalsRequest) String

func (m *EvaluateProposalsRequest) String() string

func (*EvaluateProposalsRequest) XXX_DiscardUnknown

func (m *EvaluateProposalsRequest) XXX_DiscardUnknown()

func (*EvaluateProposalsRequest) XXX_Marshal

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

func (*EvaluateProposalsRequest) XXX_Merge

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

func (*EvaluateProposalsRequest) XXX_Size

func (m *EvaluateProposalsRequest) XXX_Size() int

func (*EvaluateProposalsRequest) XXX_Unmarshal

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

type EvaluateProposalsResponse

type EvaluateProposalsResponse struct {
	// Results from evaluating proposals for this request.
	Matches              []*pb.Match `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*EvaluateProposalsResponse) Descriptor

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

func (*EvaluateProposalsResponse) GetMatches

func (m *EvaluateProposalsResponse) GetMatches() []*pb.Match

func (*EvaluateProposalsResponse) ProtoMessage

func (*EvaluateProposalsResponse) ProtoMessage()

func (*EvaluateProposalsResponse) Reset

func (m *EvaluateProposalsResponse) Reset()

func (*EvaluateProposalsResponse) String

func (m *EvaluateProposalsResponse) String() string

func (*EvaluateProposalsResponse) XXX_DiscardUnknown

func (m *EvaluateProposalsResponse) XXX_DiscardUnknown()

func (*EvaluateProposalsResponse) XXX_Marshal

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

func (*EvaluateProposalsResponse) XXX_Merge

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

func (*EvaluateProposalsResponse) XXX_Size

func (m *EvaluateProposalsResponse) XXX_Size() int

func (*EvaluateProposalsResponse) XXX_Unmarshal

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

type RegisterRequest

type RegisterRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RegisterRequest) Descriptor

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

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) Reset

func (m *RegisterRequest) Reset()

func (*RegisterRequest) String

func (m *RegisterRequest) String() string

func (*RegisterRequest) XXX_DiscardUnknown

func (m *RegisterRequest) XXX_DiscardUnknown()

func (*RegisterRequest) XXX_Marshal

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

func (*RegisterRequest) XXX_Merge

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

func (*RegisterRequest) XXX_Size

func (m *RegisterRequest) XXX_Size() int

func (*RegisterRequest) XXX_Unmarshal

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

type RegisterResponse

type RegisterResponse struct {
	// Identifier for this request valid for the current synchronization cycle.
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RegisterResponse) Descriptor

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

func (*RegisterResponse) GetId

func (m *RegisterResponse) GetId() string

func (*RegisterResponse) ProtoMessage

func (*RegisterResponse) ProtoMessage()

func (*RegisterResponse) Reset

func (m *RegisterResponse) Reset()

func (*RegisterResponse) String

func (m *RegisterResponse) String() string

func (*RegisterResponse) XXX_DiscardUnknown

func (m *RegisterResponse) XXX_DiscardUnknown()

func (*RegisterResponse) XXX_Marshal

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

func (*RegisterResponse) XXX_Merge

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

func (*RegisterResponse) XXX_Size

func (m *RegisterResponse) XXX_Size() int

func (*RegisterResponse) XXX_Unmarshal

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

type SynchronizerClient

type SynchronizerClient interface {
	// Register associates this request with the current synchronization cycle and
	// returns an identifier for this registration. The caller returns this
	// identifier back in the evaluation request. This enables synchronizer to
	// identify stale evaluation requests belonging to a prior window.
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	// EvaluateProposals accepts a list of proposals and a registration identifier
	// for this request. If the synchronization cycle to which the request was
	// registered is completed, this request fails otherwise the proposals are
	// added to the list of proposals to be evaluated in the current cycle. At the
	//  end of the cycle, the user defined evaluation method is triggered and the
	// matches accepted by it are returned as results.
	EvaluateProposals(ctx context.Context, in *EvaluateProposalsRequest, opts ...grpc.CallOption) (*EvaluateProposalsResponse, error)
}

SynchronizerClient is the client API for Synchronizer service.

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

func NewSynchronizerClient

func NewSynchronizerClient(cc *grpc.ClientConn) SynchronizerClient

type SynchronizerServer

type SynchronizerServer interface {
	// Register associates this request with the current synchronization cycle and
	// returns an identifier for this registration. The caller returns this
	// identifier back in the evaluation request. This enables synchronizer to
	// identify stale evaluation requests belonging to a prior window.
	Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
	// EvaluateProposals accepts a list of proposals and a registration identifier
	// for this request. If the synchronization cycle to which the request was
	// registered is completed, this request fails otherwise the proposals are
	// added to the list of proposals to be evaluated in the current cycle. At the
	//  end of the cycle, the user defined evaluation method is triggered and the
	// matches accepted by it are returned as results.
	EvaluateProposals(context.Context, *EvaluateProposalsRequest) (*EvaluateProposalsResponse, error)
}

SynchronizerServer is the server API for Synchronizer service.

Jump to

Keyboard shortcuts

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