Documentation ¶
Overview ¶
Package appapi is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterAppapiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAppapiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AppapiClient) error
- func RegisterAppapiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAppapiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AppapiServer) error
- func RegisterAppapiServer(s grpc.ServiceRegistrar, srv AppapiServer)
- type AppapiClient
- type AppapiMeta
- func (*AppapiMeta) Descriptor() ([]byte, []int)deprecated
- func (x *AppapiMeta) GetApplication() *application.ApplicationMete
- func (x *AppapiMeta) GetService() *service.ServiceMeta
- func (x *AppapiMeta) GetSvcapis() []*svcapi.SvcapiMeta
- func (*AppapiMeta) ProtoMessage()
- func (x *AppapiMeta) ProtoReflect() protoreflect.Message
- func (x *AppapiMeta) Reset()
- func (x *AppapiMeta) String() string
- type AppapiServer
- type GetReply
- func (*GetReply) Descriptor() ([]byte, []int)deprecated
- func (x *GetReply) GetAppapis() []*AppapiMeta
- func (x *GetReply) GetCode() int32
- func (x *GetReply) GetCount() int32
- func (x *GetReply) GetLimit() int32
- func (x *GetReply) GetMessage() string
- func (x *GetReply) GetPage() int32
- func (x *GetReply) GetTotal() int32
- func (*GetReply) ProtoMessage()
- func (x *GetReply) ProtoReflect() protoreflect.Message
- func (x *GetReply) Reset()
- func (x *GetReply) String() string
- type GetRequest
- func (*GetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetRequest) GetAppid() int32
- func (x *GetRequest) GetAppname() string
- func (x *GetRequest) GetAppsvcid() int32
- func (x *GetRequest) GetLimit() int32
- func (x *GetRequest) GetPage() int32
- func (x *GetRequest) GetSvcid() int32
- func (x *GetRequest) GetSvcname() string
- func (*GetRequest) ProtoMessage()
- func (x *GetRequest) ProtoReflect() protoreflect.Message
- func (x *GetRequest) Reset()
- func (x *GetRequest) String() string
- type UnimplementedAppapiServer
- type UnsafeAppapiServer
Constants ¶
const (
Appapi_Get_FullMethodName = "/service.collector.appapi.Appapi/Get"
)
Variables ¶
var Appapi_ServiceDesc = grpc.ServiceDesc{ ServiceName: "service.collector.appapi.Appapi", HandlerType: (*AppapiServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _Appapi_Get_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "appapi/appapi.proto", }
Appapi_ServiceDesc is the grpc.ServiceDesc for Appapi service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_appapi_appapi_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAppapiHandler ¶
RegisterAppapiHandler registers the http handlers for service Appapi to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAppapiHandlerClient ¶
func RegisterAppapiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AppapiClient) error
RegisterAppapiHandlerClient registers the http handlers for service Appapi to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AppapiClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AppapiClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AppapiClient" to call the correct interceptors.
func RegisterAppapiHandlerFromEndpoint ¶
func RegisterAppapiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAppapiHandlerFromEndpoint is same as RegisterAppapiHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAppapiHandlerServer ¶
func RegisterAppapiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AppapiServer) error
RegisterAppapiHandlerServer registers the http handlers for service Appapi to "mux". UnaryRPC :call AppapiServer 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 RegisterAppapiHandlerFromEndpoint instead.
func RegisterAppapiServer ¶
func RegisterAppapiServer(s grpc.ServiceRegistrar, srv AppapiServer)
Types ¶
type AppapiClient ¶
type AppapiClient interface {
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error)
}
AppapiClient is the client API for Appapi service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewAppapiClient ¶
func NewAppapiClient(cc grpc.ClientConnInterface) AppapiClient
type AppapiMeta ¶
type AppapiMeta struct { Application *application.ApplicationMete `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` Service *service.ServiceMeta `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` Svcapis []*svcapi.SvcapiMeta `protobuf:"bytes,3,rep,name=svcapis,proto3" json:"svcapis,omitempty"` // contains filtered or unexported fields }
func (*AppapiMeta) Descriptor
deprecated
func (*AppapiMeta) Descriptor() ([]byte, []int)
Deprecated: Use AppapiMeta.ProtoReflect.Descriptor instead.
func (*AppapiMeta) GetApplication ¶
func (x *AppapiMeta) GetApplication() *application.ApplicationMete
func (*AppapiMeta) GetService ¶
func (x *AppapiMeta) GetService() *service.ServiceMeta
func (*AppapiMeta) GetSvcapis ¶
func (x *AppapiMeta) GetSvcapis() []*svcapi.SvcapiMeta
func (*AppapiMeta) ProtoMessage ¶
func (*AppapiMeta) ProtoMessage()
func (*AppapiMeta) ProtoReflect ¶
func (x *AppapiMeta) ProtoReflect() protoreflect.Message
func (*AppapiMeta) Reset ¶
func (x *AppapiMeta) Reset()
func (*AppapiMeta) String ¶
func (x *AppapiMeta) String() string
type AppapiServer ¶
type AppapiServer interface { Get(context.Context, *GetRequest) (*GetReply, error) // contains filtered or unexported methods }
AppapiServer is the server API for Appapi service. All implementations must embed UnimplementedAppapiServer for forward compatibility
type GetReply ¶
type GetReply struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Appapis []*AppapiMeta `protobuf:"bytes,3,rep,name=appapis,proto3" json:"appapis,omitempty"` Count int32 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` Total int32 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` Page int32 `protobuf:"varint,6,opt,name=page,proto3" json:"page,omitempty"` Limit int32 `protobuf:"varint,7,opt,name=limit,proto3" json:"limit,omitempty"` // contains filtered or unexported fields }
func (*GetReply) Descriptor
deprecated
func (*GetReply) GetAppapis ¶
func (x *GetReply) GetAppapis() []*AppapiMeta
func (*GetReply) GetMessage ¶
func (*GetReply) ProtoMessage ¶
func (*GetReply) ProtoMessage()
func (*GetReply) ProtoReflect ¶
func (x *GetReply) ProtoReflect() protoreflect.Message
type GetRequest ¶
type GetRequest struct { Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` Appid int32 `protobuf:"varint,3,opt,name=appid,proto3" json:"appid,omitempty"` Appname string `protobuf:"bytes,4,opt,name=appname,proto3" json:"appname,omitempty"` Appsvcid int32 `protobuf:"varint,5,opt,name=appsvcid,proto3" json:"appsvcid,omitempty"` Svcid int32 `protobuf:"varint,6,opt,name=svcid,proto3" json:"svcid,omitempty"` Svcname string `protobuf:"bytes,7,opt,name=svcname,proto3" json:"svcname,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetAppid ¶
func (x *GetRequest) GetAppid() int32
func (*GetRequest) GetAppname ¶
func (x *GetRequest) GetAppname() string
func (*GetRequest) GetAppsvcid ¶
func (x *GetRequest) GetAppsvcid() int32
func (*GetRequest) GetLimit ¶
func (x *GetRequest) GetLimit() int32
func (*GetRequest) GetPage ¶
func (x *GetRequest) GetPage() int32
func (*GetRequest) GetSvcid ¶
func (x *GetRequest) GetSvcid() int32
func (*GetRequest) GetSvcname ¶
func (x *GetRequest) GetSvcname() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type UnimplementedAppapiServer ¶
type UnimplementedAppapiServer struct { }
UnimplementedAppapiServer must be embedded to have forward compatible implementations.
func (UnimplementedAppapiServer) Get ¶
func (UnimplementedAppapiServer) Get(context.Context, *GetRequest) (*GetReply, error)
type UnsafeAppapiServer ¶
type UnsafeAppapiServer interface {
// contains filtered or unexported methods
}
UnsafeAppapiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AppapiServer will result in compilation errors.