grpc_from0

package
v0.0.0-...-a81d9d3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package grpc_from0 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_get_interface_dumps_proto protoreflect.FileDescriptor

Functions

func RegisterGetInterfaceDumpsHandler

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

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

func RegisterGetInterfaceDumpsHandlerClient

func RegisterGetInterfaceDumpsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GetInterfaceDumpsClient) error

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

func RegisterGetInterfaceDumpsHandlerFromEndpoint

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

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

func RegisterGetInterfaceDumpsHandlerServer

func RegisterGetInterfaceDumpsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GetInterfaceDumpsServer) error

RegisterGetInterfaceDumpsHandlerServer registers the http handlers for service GetInterfaceDumps to "mux". UnaryRPC :call GetInterfaceDumpsServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterGetInterfaceDumpsHandlerFromEndpoint instead.

func RegisterGetInterfaceDumpsServer

func RegisterGetInterfaceDumpsServer(s *grpc.Server, srv GetInterfaceDumpsServer)

Types

type Dump

type Dump 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"`
	Mac     string `protobuf:"bytes,3,opt,name=mac,proto3" json:"mac,omitempty"`
	Ip      string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"`
	Dns     string `protobuf:"bytes,5,opt,name=dns,proto3" json:"dns,omitempty"`
	Gateway string `protobuf:"bytes,6,opt,name=gateway,proto3" json:"gateway,omitempty"`
	// contains filtered or unexported fields
}

func (*Dump) Descriptor deprecated

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

Deprecated: Use Dump.ProtoReflect.Descriptor instead.

func (*Dump) GetDns

func (x *Dump) GetDns() string

func (*Dump) GetGateway

func (x *Dump) GetGateway() string

func (*Dump) GetId

func (x *Dump) GetId() string

func (*Dump) GetIp

func (x *Dump) GetIp() string

func (*Dump) GetMac

func (x *Dump) GetMac() string

func (*Dump) GetName

func (x *Dump) GetName() string

func (*Dump) ProtoMessage

func (*Dump) ProtoMessage()

func (*Dump) ProtoReflect

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

func (*Dump) Reset

func (x *Dump) Reset()

func (*Dump) String

func (x *Dump) String() string

type Dumps

type Dumps struct {
	Dumps []*Dump `protobuf:"bytes,1,rep,name=dumps,proto3" json:"dumps,omitempty"`
	// contains filtered or unexported fields
}

func (*Dumps) Descriptor deprecated

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

Deprecated: Use Dumps.ProtoReflect.Descriptor instead.

func (*Dumps) GetDumps

func (x *Dumps) GetDumps() []*Dump

func (*Dumps) ProtoMessage

func (*Dumps) ProtoMessage()

func (*Dumps) ProtoReflect

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

func (*Dumps) Reset

func (x *Dumps) Reset()

func (*Dumps) String

func (x *Dumps) String() string

type GetInterfaceDumpsClient

type GetInterfaceDumpsClient interface {
	GetInterfaceDumps(ctx context.Context, in *GetInterfaceDumpsRequest, opts ...grpc.CallOption) (*Dumps, error)
}

GetInterfaceDumpsClient is the client API for GetInterfaceDumps service.

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

type GetInterfaceDumpsRequest

type GetInterfaceDumpsRequest struct {
	LastCount int32 `protobuf:"varint,1,opt,name=last_count,json=lastCount,proto3" json:"last_count,omitempty"`
	// contains filtered or unexported fields
}

func (*GetInterfaceDumpsRequest) Descriptor deprecated

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

Deprecated: Use GetInterfaceDumpsRequest.ProtoReflect.Descriptor instead.

func (*GetInterfaceDumpsRequest) GetLastCount

func (x *GetInterfaceDumpsRequest) GetLastCount() int32

func (*GetInterfaceDumpsRequest) ProtoMessage

func (*GetInterfaceDumpsRequest) ProtoMessage()

func (*GetInterfaceDumpsRequest) ProtoReflect

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

func (*GetInterfaceDumpsRequest) Reset

func (x *GetInterfaceDumpsRequest) Reset()

func (*GetInterfaceDumpsRequest) String

func (x *GetInterfaceDumpsRequest) String() string

type GetInterfaceDumpsServer

type GetInterfaceDumpsServer interface {
	GetInterfaceDumps(context.Context, *GetInterfaceDumpsRequest) (*Dumps, error)
}

GetInterfaceDumpsServer is the server API for GetInterfaceDumps service.

type UnimplementedGetInterfaceDumpsServer

type UnimplementedGetInterfaceDumpsServer struct {
}

UnimplementedGetInterfaceDumpsServer can be embedded to have forward compatible implementations.

func (*UnimplementedGetInterfaceDumpsServer) GetInterfaceDumps

Jump to

Keyboard shortcuts

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