863 lines
26 KiB
Go
863 lines
26 KiB
Go
// Code generated by protoc-gen-go.
|
|
// source: route.proto
|
|
// DO NOT EDIT!
|
|
|
|
/*
|
|
Package route is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
route.proto
|
|
|
|
It has these top-level messages:
|
|
Nil
|
|
GetRouteRequest
|
|
Route
|
|
GetAllRoutesResponse
|
|
IDResponse
|
|
Token
|
|
TokenSet
|
|
GetTokenRequest
|
|
Backend
|
|
BackendList
|
|
BackendSelector
|
|
BackendID
|
|
*/
|
|
package route
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
type Nil struct {
|
|
}
|
|
|
|
func (m *Nil) Reset() { *m = Nil{} }
|
|
func (m *Nil) String() string { return proto.CompactTextString(m) }
|
|
func (*Nil) ProtoMessage() {}
|
|
func (*Nil) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
type GetRouteRequest struct {
|
|
Host string `protobuf:"bytes,1,opt,name=host" json:"host,omitempty"`
|
|
}
|
|
|
|
func (m *GetRouteRequest) Reset() { *m = GetRouteRequest{} }
|
|
func (m *GetRouteRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*GetRouteRequest) ProtoMessage() {}
|
|
func (*GetRouteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
func (m *GetRouteRequest) GetHost() string {
|
|
if m != nil {
|
|
return m.Host
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type Route struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Creator string `protobuf:"bytes,2,opt,name=creator" json:"creator,omitempty"`
|
|
Host string `protobuf:"bytes,3,opt,name=host" json:"host,omitempty"`
|
|
}
|
|
|
|
func (m *Route) Reset() { *m = Route{} }
|
|
func (m *Route) String() string { return proto.CompactTextString(m) }
|
|
func (*Route) ProtoMessage() {}
|
|
func (*Route) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
|
|
|
func (m *Route) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Route) GetCreator() string {
|
|
if m != nil {
|
|
return m.Creator
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Route) GetHost() string {
|
|
if m != nil {
|
|
return m.Host
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type GetAllRoutesResponse struct {
|
|
Routes []*Route `protobuf:"bytes,1,rep,name=routes" json:"routes,omitempty"`
|
|
}
|
|
|
|
func (m *GetAllRoutesResponse) Reset() { *m = GetAllRoutesResponse{} }
|
|
func (m *GetAllRoutesResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*GetAllRoutesResponse) ProtoMessage() {}
|
|
func (*GetAllRoutesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
|
|
|
|
func (m *GetAllRoutesResponse) GetRoutes() []*Route {
|
|
if m != nil {
|
|
return m.Routes
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type IDResponse struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
}
|
|
|
|
func (m *IDResponse) Reset() { *m = IDResponse{} }
|
|
func (m *IDResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*IDResponse) ProtoMessage() {}
|
|
func (*IDResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
|
|
|
|
func (m *IDResponse) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type Token struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Body string `protobuf:"bytes,2,opt,name=body" json:"body,omitempty"`
|
|
Scopes []string `protobuf:"bytes,3,rep,name=scopes" json:"scopes,omitempty"`
|
|
Active bool `protobuf:"varint,4,opt,name=active" json:"active,omitempty"`
|
|
}
|
|
|
|
func (m *Token) Reset() { *m = Token{} }
|
|
func (m *Token) String() string { return proto.CompactTextString(m) }
|
|
func (*Token) ProtoMessage() {}
|
|
func (*Token) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
|
|
|
|
func (m *Token) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Token) GetBody() string {
|
|
if m != nil {
|
|
return m.Body
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Token) GetScopes() []string {
|
|
if m != nil {
|
|
return m.Scopes
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Token) GetActive() bool {
|
|
if m != nil {
|
|
return m.Active
|
|
}
|
|
return false
|
|
}
|
|
|
|
type TokenSet struct {
|
|
Tokens []*Token `protobuf:"bytes,1,rep,name=tokens" json:"tokens,omitempty"`
|
|
}
|
|
|
|
func (m *TokenSet) Reset() { *m = TokenSet{} }
|
|
func (m *TokenSet) String() string { return proto.CompactTextString(m) }
|
|
func (*TokenSet) ProtoMessage() {}
|
|
func (*TokenSet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
|
|
|
|
func (m *TokenSet) GetTokens() []*Token {
|
|
if m != nil {
|
|
return m.Tokens
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type GetTokenRequest struct {
|
|
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
|
|
Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"`
|
|
}
|
|
|
|
func (m *GetTokenRequest) Reset() { *m = GetTokenRequest{} }
|
|
func (m *GetTokenRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*GetTokenRequest) ProtoMessage() {}
|
|
func (*GetTokenRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
|
|
|
|
func (m *GetTokenRequest) GetToken() string {
|
|
if m != nil {
|
|
return m.Token
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *GetTokenRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type Backend struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Proto string `protobuf:"bytes,2,opt,name=proto" json:"proto,omitempty"`
|
|
User string `protobuf:"bytes,3,opt,name=user" json:"user,omitempty"`
|
|
Domain string `protobuf:"bytes,4,opt,name=domain" json:"domain,omitempty"`
|
|
Phi float32 `protobuf:"fixed32,5,opt,name=phi" json:"phi,omitempty"`
|
|
Host string `protobuf:"bytes,6,opt,name=host" json:"host,omitempty"`
|
|
Usable bool `protobuf:"varint,7,opt,name=usable" json:"usable,omitempty"`
|
|
}
|
|
|
|
func (m *Backend) Reset() { *m = Backend{} }
|
|
func (m *Backend) String() string { return proto.CompactTextString(m) }
|
|
func (*Backend) ProtoMessage() {}
|
|
func (*Backend) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
|
|
|
|
func (m *Backend) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Backend) GetProto() string {
|
|
if m != nil {
|
|
return m.Proto
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Backend) GetUser() string {
|
|
if m != nil {
|
|
return m.User
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Backend) GetDomain() string {
|
|
if m != nil {
|
|
return m.Domain
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Backend) GetPhi() float32 {
|
|
if m != nil {
|
|
return m.Phi
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Backend) GetHost() string {
|
|
if m != nil {
|
|
return m.Host
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Backend) GetUsable() bool {
|
|
if m != nil {
|
|
return m.Usable
|
|
}
|
|
return false
|
|
}
|
|
|
|
type BackendList struct {
|
|
Bs *BackendSelector `protobuf:"bytes,1,opt,name=bs" json:"bs,omitempty"`
|
|
Backends []*Backend `protobuf:"bytes,2,rep,name=backends" json:"backends,omitempty"`
|
|
}
|
|
|
|
func (m *BackendList) Reset() { *m = BackendList{} }
|
|
func (m *BackendList) String() string { return proto.CompactTextString(m) }
|
|
func (*BackendList) ProtoMessage() {}
|
|
func (*BackendList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }
|
|
|
|
func (m *BackendList) GetBs() *BackendSelector {
|
|
if m != nil {
|
|
return m.Bs
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *BackendList) GetBackends() []*Backend {
|
|
if m != nil {
|
|
return m.Backends
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type BackendSelector struct {
|
|
Domain string `protobuf:"bytes,1,opt,name=domain" json:"domain,omitempty"`
|
|
User string `protobuf:"bytes,2,opt,name=user" json:"user,omitempty"`
|
|
}
|
|
|
|
func (m *BackendSelector) Reset() { *m = BackendSelector{} }
|
|
func (m *BackendSelector) String() string { return proto.CompactTextString(m) }
|
|
func (*BackendSelector) ProtoMessage() {}
|
|
func (*BackendSelector) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }
|
|
|
|
func (m *BackendSelector) GetDomain() string {
|
|
if m != nil {
|
|
return m.Domain
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *BackendSelector) GetUser() string {
|
|
if m != nil {
|
|
return m.User
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type BackendID struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
}
|
|
|
|
func (m *BackendID) Reset() { *m = BackendID{} }
|
|
func (m *BackendID) String() string { return proto.CompactTextString(m) }
|
|
func (*BackendID) ProtoMessage() {}
|
|
func (*BackendID) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
|
|
|
|
func (m *BackendID) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Nil)(nil), "route.Nil")
|
|
proto.RegisterType((*GetRouteRequest)(nil), "route.GetRouteRequest")
|
|
proto.RegisterType((*Route)(nil), "route.Route")
|
|
proto.RegisterType((*GetAllRoutesResponse)(nil), "route.GetAllRoutesResponse")
|
|
proto.RegisterType((*IDResponse)(nil), "route.IDResponse")
|
|
proto.RegisterType((*Token)(nil), "route.Token")
|
|
proto.RegisterType((*TokenSet)(nil), "route.TokenSet")
|
|
proto.RegisterType((*GetTokenRequest)(nil), "route.GetTokenRequest")
|
|
proto.RegisterType((*Backend)(nil), "route.Backend")
|
|
proto.RegisterType((*BackendList)(nil), "route.BackendList")
|
|
proto.RegisterType((*BackendSelector)(nil), "route.BackendSelector")
|
|
proto.RegisterType((*BackendID)(nil), "route.BackendID")
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// Client API for Routes service
|
|
|
|
type RoutesClient interface {
|
|
Get(ctx context.Context, in *GetRouteRequest, opts ...grpc.CallOption) (*Route, error)
|
|
GetAll(ctx context.Context, in *Nil, opts ...grpc.CallOption) (*GetAllRoutesResponse, error)
|
|
Put(ctx context.Context, in *Route, opts ...grpc.CallOption) (*IDResponse, error)
|
|
Delete(ctx context.Context, in *Route, opts ...grpc.CallOption) (*IDResponse, error)
|
|
}
|
|
|
|
type routesClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewRoutesClient(cc *grpc.ClientConn) RoutesClient {
|
|
return &routesClient{cc}
|
|
}
|
|
|
|
func (c *routesClient) Get(ctx context.Context, in *GetRouteRequest, opts ...grpc.CallOption) (*Route, error) {
|
|
out := new(Route)
|
|
err := grpc.Invoke(ctx, "/route.Routes/Get", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *routesClient) GetAll(ctx context.Context, in *Nil, opts ...grpc.CallOption) (*GetAllRoutesResponse, error) {
|
|
out := new(GetAllRoutesResponse)
|
|
err := grpc.Invoke(ctx, "/route.Routes/GetAll", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *routesClient) Put(ctx context.Context, in *Route, opts ...grpc.CallOption) (*IDResponse, error) {
|
|
out := new(IDResponse)
|
|
err := grpc.Invoke(ctx, "/route.Routes/Put", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *routesClient) Delete(ctx context.Context, in *Route, opts ...grpc.CallOption) (*IDResponse, error) {
|
|
out := new(IDResponse)
|
|
err := grpc.Invoke(ctx, "/route.Routes/Delete", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for Routes service
|
|
|
|
type RoutesServer interface {
|
|
Get(context.Context, *GetRouteRequest) (*Route, error)
|
|
GetAll(context.Context, *Nil) (*GetAllRoutesResponse, error)
|
|
Put(context.Context, *Route) (*IDResponse, error)
|
|
Delete(context.Context, *Route) (*IDResponse, error)
|
|
}
|
|
|
|
func RegisterRoutesServer(s *grpc.Server, srv RoutesServer) {
|
|
s.RegisterService(&_Routes_serviceDesc, srv)
|
|
}
|
|
|
|
func _Routes_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetRouteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(RoutesServer).Get(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Routes/Get",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(RoutesServer).Get(ctx, req.(*GetRouteRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Routes_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Nil)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(RoutesServer).GetAll(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Routes/GetAll",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(RoutesServer).GetAll(ctx, req.(*Nil))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Routes_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Route)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(RoutesServer).Put(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Routes/Put",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(RoutesServer).Put(ctx, req.(*Route))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Routes_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Route)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(RoutesServer).Delete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Routes/Delete",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(RoutesServer).Delete(ctx, req.(*Route))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Routes_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "route.Routes",
|
|
HandlerType: (*RoutesServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Get",
|
|
Handler: _Routes_Get_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetAll",
|
|
Handler: _Routes_GetAll_Handler,
|
|
},
|
|
{
|
|
MethodName: "Put",
|
|
Handler: _Routes_Put_Handler,
|
|
},
|
|
{
|
|
MethodName: "Delete",
|
|
Handler: _Routes_Delete_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "route.proto",
|
|
}
|
|
|
|
// Client API for Tokens service
|
|
|
|
type TokensClient interface {
|
|
Get(ctx context.Context, in *GetTokenRequest, opts ...grpc.CallOption) (*Token, error)
|
|
GetAll(ctx context.Context, in *Nil, opts ...grpc.CallOption) (*TokenSet, error)
|
|
Put(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Token, error)
|
|
Delete(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Nil, error)
|
|
Deactivate(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Nil, error)
|
|
}
|
|
|
|
type tokensClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewTokensClient(cc *grpc.ClientConn) TokensClient {
|
|
return &tokensClient{cc}
|
|
}
|
|
|
|
func (c *tokensClient) Get(ctx context.Context, in *GetTokenRequest, opts ...grpc.CallOption) (*Token, error) {
|
|
out := new(Token)
|
|
err := grpc.Invoke(ctx, "/route.Tokens/Get", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tokensClient) GetAll(ctx context.Context, in *Nil, opts ...grpc.CallOption) (*TokenSet, error) {
|
|
out := new(TokenSet)
|
|
err := grpc.Invoke(ctx, "/route.Tokens/GetAll", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tokensClient) Put(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Token, error) {
|
|
out := new(Token)
|
|
err := grpc.Invoke(ctx, "/route.Tokens/Put", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tokensClient) Delete(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Nil, error) {
|
|
out := new(Nil)
|
|
err := grpc.Invoke(ctx, "/route.Tokens/Delete", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tokensClient) Deactivate(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Nil, error) {
|
|
out := new(Nil)
|
|
err := grpc.Invoke(ctx, "/route.Tokens/Deactivate", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for Tokens service
|
|
|
|
type TokensServer interface {
|
|
Get(context.Context, *GetTokenRequest) (*Token, error)
|
|
GetAll(context.Context, *Nil) (*TokenSet, error)
|
|
Put(context.Context, *Token) (*Token, error)
|
|
Delete(context.Context, *Token) (*Nil, error)
|
|
Deactivate(context.Context, *Token) (*Nil, error)
|
|
}
|
|
|
|
func RegisterTokensServer(s *grpc.Server, srv TokensServer) {
|
|
s.RegisterService(&_Tokens_serviceDesc, srv)
|
|
}
|
|
|
|
func _Tokens_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetTokenRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TokensServer).Get(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Tokens/Get",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TokensServer).Get(ctx, req.(*GetTokenRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Tokens_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Nil)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TokensServer).GetAll(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Tokens/GetAll",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TokensServer).GetAll(ctx, req.(*Nil))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Tokens_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Token)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TokensServer).Put(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Tokens/Put",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TokensServer).Put(ctx, req.(*Token))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Tokens_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Token)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TokensServer).Delete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Tokens/Delete",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TokensServer).Delete(ctx, req.(*Token))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Tokens_Deactivate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Token)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TokensServer).Deactivate(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Tokens/Deactivate",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TokensServer).Deactivate(ctx, req.(*Token))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Tokens_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "route.Tokens",
|
|
HandlerType: (*TokensServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Get",
|
|
Handler: _Tokens_Get_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetAll",
|
|
Handler: _Tokens_GetAll_Handler,
|
|
},
|
|
{
|
|
MethodName: "Put",
|
|
Handler: _Tokens_Put_Handler,
|
|
},
|
|
{
|
|
MethodName: "Delete",
|
|
Handler: _Tokens_Delete_Handler,
|
|
},
|
|
{
|
|
MethodName: "Deactivate",
|
|
Handler: _Tokens_Deactivate_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "route.proto",
|
|
}
|
|
|
|
// Client API for Backends service
|
|
|
|
type BackendsClient interface {
|
|
List(ctx context.Context, in *BackendSelector, opts ...grpc.CallOption) (*BackendList, error)
|
|
Kill(ctx context.Context, in *BackendID, opts ...grpc.CallOption) (*Nil, error)
|
|
}
|
|
|
|
type backendsClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewBackendsClient(cc *grpc.ClientConn) BackendsClient {
|
|
return &backendsClient{cc}
|
|
}
|
|
|
|
func (c *backendsClient) List(ctx context.Context, in *BackendSelector, opts ...grpc.CallOption) (*BackendList, error) {
|
|
out := new(BackendList)
|
|
err := grpc.Invoke(ctx, "/route.Backends/List", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backendsClient) Kill(ctx context.Context, in *BackendID, opts ...grpc.CallOption) (*Nil, error) {
|
|
out := new(Nil)
|
|
err := grpc.Invoke(ctx, "/route.Backends/Kill", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for Backends service
|
|
|
|
type BackendsServer interface {
|
|
List(context.Context, *BackendSelector) (*BackendList, error)
|
|
Kill(context.Context, *BackendID) (*Nil, error)
|
|
}
|
|
|
|
func RegisterBackendsServer(s *grpc.Server, srv BackendsServer) {
|
|
s.RegisterService(&_Backends_serviceDesc, srv)
|
|
}
|
|
|
|
func _Backends_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(BackendSelector)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BackendsServer).List(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Backends/List",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BackendsServer).List(ctx, req.(*BackendSelector))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Backends_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(BackendID)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BackendsServer).Kill(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/route.Backends/Kill",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BackendsServer).Kill(ctx, req.(*BackendID))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Backends_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "route.Backends",
|
|
HandlerType: (*BackendsServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "List",
|
|
Handler: _Backends_List_Handler,
|
|
},
|
|
{
|
|
MethodName: "Kill",
|
|
Handler: _Backends_Kill_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "route.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("route.proto", fileDescriptor0) }
|
|
|
|
var fileDescriptor0 = []byte{
|
|
// 565 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x5d, 0x8b, 0xd3, 0x40,
|
|
0x14, 0xcd, 0x47, 0x93, 0xb6, 0xb7, 0xb2, 0x5d, 0x2f, 0x65, 0x09, 0x5d, 0x1f, 0xca, 0xb8, 0xae,
|
|
0x41, 0x71, 0x91, 0xae, 0xe0, 0x8b, 0x3e, 0x28, 0x95, 0x52, 0x94, 0x45, 0x52, 0xdf, 0x7c, 0x4a,
|
|
0xda, 0x0b, 0x0d, 0x1b, 0x3b, 0x35, 0x33, 0x15, 0xfc, 0x29, 0xfe, 0x1e, 0x7f, 0x83, 0xff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