proto

package
v0.0.0-...-08d06e6 Latest Latest
Warning

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

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

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var DigOutStatus_name = map[int32]string{
	0: "Open",
	1: "Opening",
	2: "Closing",
	3: "Closed",
	4: "Unknown",
}
View Source
var DigOutStatus_value = map[string]int32{
	"Open":    0,
	"Opening": 1,
	"Closing": 2,
	"Closed":  3,
	"Unknown": 4,
}

Functions

func RegisterDdduServiceHandler

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

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

func RegisterDdduServiceHandlerClient

func RegisterDdduServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DdduServiceClient) error

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

func RegisterDdduServiceHandlerFromEndpoint

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

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

func RegisterDdduServiceServer

func RegisterDdduServiceServer(s *grpc.Server, srv DdduServiceServer)

Types

type DdduServiceClient

type DdduServiceClient interface {
	GetServices(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ServicesReply, error)
	DigOut(ctx context.Context, in *DigOutRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	DeDigOut(ctx context.Context, in *DigOutRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}

DdduServiceClient is the client API for DdduService service.

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

func NewDdduServiceClient

func NewDdduServiceClient(cc *grpc.ClientConn) DdduServiceClient

type DdduServiceServer

type DdduServiceServer interface {
	GetServices(context.Context, *empty.Empty) (*ServicesReply, error)
	DigOut(context.Context, *DigOutRequest) (*empty.Empty, error)
	DeDigOut(context.Context, *DigOutRequest) (*empty.Empty, error)
}

DdduServiceServer is the server API for DdduService service.

type DigOutRequest

type DigOutRequest struct {
	ServiceName          string   `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DigOutRequest) Descriptor

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

func (*DigOutRequest) GetServiceName

func (m *DigOutRequest) GetServiceName() string

func (*DigOutRequest) ProtoMessage

func (*DigOutRequest) ProtoMessage()

func (*DigOutRequest) Reset

func (m *DigOutRequest) Reset()

func (*DigOutRequest) String

func (m *DigOutRequest) String() string

func (*DigOutRequest) XXX_DiscardUnknown

func (m *DigOutRequest) XXX_DiscardUnknown()

func (*DigOutRequest) XXX_Marshal

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

func (*DigOutRequest) XXX_Merge

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

func (*DigOutRequest) XXX_Size

func (m *DigOutRequest) XXX_Size() int

func (*DigOutRequest) XXX_Unmarshal

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

type DigOutStatus

type DigOutStatus int32
const (
	DigOutStatus_Open    DigOutStatus = 0
	DigOutStatus_Opening DigOutStatus = 1
	DigOutStatus_Closing DigOutStatus = 2
	DigOutStatus_Closed  DigOutStatus = 3
	DigOutStatus_Unknown DigOutStatus = 4
)

func (DigOutStatus) EnumDescriptor

func (DigOutStatus) EnumDescriptor() ([]byte, []int)

func (DigOutStatus) String

func (x DigOutStatus) String() string

type Service

type Service struct {
	Id                   string       `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string       `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	DigoutStatus         DigOutStatus `protobuf:"varint,3,opt,name=digout_status,json=digoutStatus,proto3,enum=proto.DigOutStatus" json:"digout_status,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*Service) Descriptor

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

func (*Service) GetDigoutStatus

func (m *Service) GetDigoutStatus() DigOutStatus

func (*Service) GetId

func (m *Service) GetId() string

func (*Service) GetName

func (m *Service) GetName() string

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) String

func (m *Service) String() string

func (*Service) XXX_DiscardUnknown

func (m *Service) XXX_DiscardUnknown()

func (*Service) XXX_Marshal

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

func (*Service) XXX_Merge

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

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

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

type ServicesReply

type ServicesReply struct {
	Items                []*Service `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*ServicesReply) Descriptor

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

func (*ServicesReply) GetItems

func (m *ServicesReply) GetItems() []*Service

func (*ServicesReply) ProtoMessage

func (*ServicesReply) ProtoMessage()

func (*ServicesReply) Reset

func (m *ServicesReply) Reset()

func (*ServicesReply) String

func (m *ServicesReply) String() string

func (*ServicesReply) XXX_DiscardUnknown

func (m *ServicesReply) XXX_DiscardUnknown()

func (*ServicesReply) XXX_Marshal

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

func (*ServicesReply) XXX_Merge

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

func (*ServicesReply) XXX_Size

func (m *ServicesReply) XXX_Size() int

func (*ServicesReply) XXX_Unmarshal

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

type UnimplementedDdduServiceServer

type UnimplementedDdduServiceServer struct {
}

UnimplementedDdduServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedDdduServiceServer) DeDigOut

func (*UnimplementedDdduServiceServer) DigOut

func (*UnimplementedDdduServiceServer) GetServices

Jump to

Keyboard shortcuts

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