svcapieg

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package svcapieg is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_svcapieg_svcapieg_proto protoreflect.FileDescriptor
View Source
var Svcapieg_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "service.collector.svcapieg.Svcapieg",
	HandlerType: (*SvcapiegServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _Svcapieg_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Svcapieg_Get_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Svcapieg_Delete_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _Svcapieg_Update_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "svcapieg/svcapieg.proto",
}

Svcapieg_ServiceDesc is the grpc.ServiceDesc for Svcapieg service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterSvcapiegHandler

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

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

func RegisterSvcapiegHandlerClient

func RegisterSvcapiegHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SvcapiegClient) error

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

func RegisterSvcapiegHandlerFromEndpoint

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

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

func RegisterSvcapiegHandlerServer

func RegisterSvcapiegHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SvcapiegServer) error

RegisterSvcapiegHandlerServer registers the http handlers for service Svcapieg to "mux". UnaryRPC :call SvcapiegServer 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 RegisterSvcapiegHandlerFromEndpoint instead.

func RegisterSvcapiegServer

func RegisterSvcapiegServer(s grpc.ServiceRegistrar, srv SvcapiegServer)

Types

type CreateReply

type CreateReply 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"`
	Svcapieg *SvcapiegMeta `protobuf:"bytes,3,opt,name=svcapieg,proto3" json:"svcapieg,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateReply) Descriptor deprecated

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

Deprecated: Use CreateReply.ProtoReflect.Descriptor instead.

func (*CreateReply) GetCode

func (x *CreateReply) GetCode() int32

func (*CreateReply) GetMessage

func (x *CreateReply) GetMessage() string

func (*CreateReply) GetSvcapieg

func (x *CreateReply) GetSvcapieg() *SvcapiegMeta

func (*CreateReply) ProtoMessage

func (*CreateReply) ProtoMessage()

func (*CreateReply) ProtoReflect

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

func (*CreateReply) Reset

func (x *CreateReply) Reset()

func (*CreateReply) String

func (x *CreateReply) String() string

type CreateRequest

type CreateRequest struct {
	ServiceId int32  `protobuf:"varint,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	SvcapiId  int32  `protobuf:"varint,2,opt,name=svcapi_id,json=svcapiId,proto3" json:"svcapi_id,omitempty"`
	Data      string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRequest) Descriptor deprecated

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetData

func (x *CreateRequest) GetData() string

func (*CreateRequest) GetServiceId

func (x *CreateRequest) GetServiceId() int32

func (*CreateRequest) GetSvcapiId

func (x *CreateRequest) GetSvcapiId() int32

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type DeleteReply

type DeleteReply 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"`
	// contains filtered or unexported fields
}

func (*DeleteReply) Descriptor deprecated

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

Deprecated: Use DeleteReply.ProtoReflect.Descriptor instead.

func (*DeleteReply) GetCode

func (x *DeleteReply) GetCode() int32

func (*DeleteReply) GetMessage

func (x *DeleteReply) GetMessage() string

func (*DeleteReply) ProtoMessage

func (*DeleteReply) ProtoMessage()

func (*DeleteReply) ProtoReflect

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

func (*DeleteReply) Reset

func (x *DeleteReply) Reset()

func (*DeleteReply) String

func (x *DeleteReply) String() string

type DeleteRequest

type DeleteRequest struct {
	ServiceId int32 `protobuf:"varint,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	SvcapiId  int32 `protobuf:"varint,2,opt,name=svcapi_id,json=svcapiId,proto3" json:"svcapi_id,omitempty"`
	Uuid      int32 `protobuf:"varint,3,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetServiceId

func (x *DeleteRequest) GetServiceId() int32

func (*DeleteRequest) GetSvcapiId

func (x *DeleteRequest) GetSvcapiId() int32

func (*DeleteRequest) GetUuid

func (x *DeleteRequest) GetUuid() int32

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

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"`
	Svcapiegs []*SvcapiegMeta `protobuf:"bytes,3,rep,name=svcapiegs,proto3" json:"svcapiegs,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) Descriptor() ([]byte, []int)

Deprecated: Use GetReply.ProtoReflect.Descriptor instead.

func (*GetReply) GetCode

func (x *GetReply) GetCode() int32

func (*GetReply) GetCount

func (x *GetReply) GetCount() int32

func (*GetReply) GetLimit

func (x *GetReply) GetLimit() int32

func (*GetReply) GetMessage

func (x *GetReply) GetMessage() string

func (*GetReply) GetPage

func (x *GetReply) GetPage() int32

func (*GetReply) GetSvcapiegs

func (x *GetReply) GetSvcapiegs() []*SvcapiegMeta

func (*GetReply) GetTotal

func (x *GetReply) GetTotal() int32

func (*GetReply) ProtoMessage

func (*GetReply) ProtoMessage()

func (*GetReply) ProtoReflect

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

func (*GetReply) Reset

func (x *GetReply) Reset()

func (*GetReply) String

func (x *GetReply) String() string

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"`
	ServiceId int32 `protobuf:"varint,3,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	SvcapiId  int32 `protobuf:"varint,4,opt,name=svcapi_id,json=svcapiId,proto3" json:"svcapi_id,omitempty"`
	Uuid      int32 `protobuf:"varint,5,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetLimit

func (x *GetRequest) GetLimit() int32

func (*GetRequest) GetPage

func (x *GetRequest) GetPage() int32

func (*GetRequest) GetServiceId

func (x *GetRequest) GetServiceId() int32

func (*GetRequest) GetSvcapiId

func (x *GetRequest) GetSvcapiId() int32

func (*GetRequest) GetUuid

func (x *GetRequest) GetUuid() int32

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 SvcapiegClient

type SvcapiegClient interface {
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateReply, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteReply, error)
	Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateReply, error)
}

SvcapiegClient is the client API for Svcapieg 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 NewSvcapiegClient

func NewSvcapiegClient(cc grpc.ClientConnInterface) SvcapiegClient

type SvcapiegMeta

type SvcapiegMeta struct {
	Uuid int32  `protobuf:"varint,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// bytes data = 2;
	// google.protobuf.BytesValue data = 2;
	// service.collector.anypb.Any data = 2;
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	UpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	SvcapiId   int32                  `protobuf:"varint,5,opt,name=svcapi_id,json=svcapiId,proto3" json:"svcapi_id,omitempty"`
	// int32 service_id = 6;
	TenantId int32 `protobuf:"varint,7,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
	// contains filtered or unexported fields
}

func (*SvcapiegMeta) Descriptor deprecated

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

Deprecated: Use SvcapiegMeta.ProtoReflect.Descriptor instead.

func (*SvcapiegMeta) GetCreateTime

func (x *SvcapiegMeta) GetCreateTime() *timestamppb.Timestamp

func (*SvcapiegMeta) GetData

func (x *SvcapiegMeta) GetData() string

func (*SvcapiegMeta) GetSvcapiId

func (x *SvcapiegMeta) GetSvcapiId() int32

func (*SvcapiegMeta) GetTenantId

func (x *SvcapiegMeta) GetTenantId() int32

func (*SvcapiegMeta) GetUpdateTime

func (x *SvcapiegMeta) GetUpdateTime() *timestamppb.Timestamp

func (*SvcapiegMeta) GetUuid

func (x *SvcapiegMeta) GetUuid() int32

func (*SvcapiegMeta) ProtoMessage

func (*SvcapiegMeta) ProtoMessage()

func (*SvcapiegMeta) ProtoReflect

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

func (*SvcapiegMeta) Reset

func (x *SvcapiegMeta) Reset()

func (*SvcapiegMeta) String

func (x *SvcapiegMeta) String() string

type SvcapiegServer

type SvcapiegServer interface {
	Create(context.Context, *CreateRequest) (*CreateReply, error)
	Get(context.Context, *GetRequest) (*GetReply, error)
	Delete(context.Context, *DeleteRequest) (*DeleteReply, error)
	Update(context.Context, *UpdateRequest) (*UpdateReply, error)
	// contains filtered or unexported methods
}

SvcapiegServer is the server API for Svcapieg service. All implementations must embed UnimplementedSvcapiegServer for forward compatibility

type Timestamp

type Timestamp = timestamppb.Timestamp

type UnimplementedSvcapiegServer

type UnimplementedSvcapiegServer struct {
}

UnimplementedSvcapiegServer must be embedded to have forward compatible implementations.

func (UnimplementedSvcapiegServer) Create

func (UnimplementedSvcapiegServer) Delete

func (UnimplementedSvcapiegServer) Get

func (UnimplementedSvcapiegServer) Update

type UnsafeSvcapiegServer

type UnsafeSvcapiegServer interface {
	// contains filtered or unexported methods
}

UnsafeSvcapiegServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SvcapiegServer will result in compilation errors.

type UpdateReply

type UpdateReply 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"`
	Svcapieg *SvcapiegMeta `protobuf:"bytes,3,opt,name=svcapieg,proto3" json:"svcapieg,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateReply) Descriptor deprecated

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

Deprecated: Use UpdateReply.ProtoReflect.Descriptor instead.

func (*UpdateReply) GetCode

func (x *UpdateReply) GetCode() int32

func (*UpdateReply) GetMessage

func (x *UpdateReply) GetMessage() string

func (*UpdateReply) GetSvcapieg

func (x *UpdateReply) GetSvcapieg() *SvcapiegMeta

func (*UpdateReply) ProtoMessage

func (*UpdateReply) ProtoMessage()

func (*UpdateReply) ProtoReflect

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

func (*UpdateReply) Reset

func (x *UpdateReply) Reset()

func (*UpdateReply) String

func (x *UpdateReply) String() string

type UpdateRequest

type UpdateRequest struct {
	ServiceId int32  `protobuf:"varint,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	SvcapiId  int32  `protobuf:"varint,2,opt,name=svcapi_id,json=svcapiId,proto3" json:"svcapi_id,omitempty"`
	Uuid      int32  `protobuf:"varint,3,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Data      string `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateRequest) Descriptor deprecated

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

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetData

func (x *UpdateRequest) GetData() string

func (*UpdateRequest) GetServiceId

func (x *UpdateRequest) GetServiceId() int32

func (*UpdateRequest) GetSvcapiId

func (x *UpdateRequest) GetSvcapiId() int32

func (*UpdateRequest) GetUuid

func (x *UpdateRequest) GetUuid() int32

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

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

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

Jump to

Keyboard shortcuts

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