tenant

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 tenant is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_tenant_tenant_proto protoreflect.FileDescriptor
View Source
var Tenant_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "service.collector.tenant.Tenant",
	HandlerType: (*TenantServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _Tenant_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Tenant_Get_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Tenant_Delete_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _Tenant_Update_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "tenant/tenant.proto",
}

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

Functions

func RegisterTenantHandler

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

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

func RegisterTenantHandlerClient

func RegisterTenantHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TenantClient) error

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

func RegisterTenantHandlerFromEndpoint

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

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

func RegisterTenantHandlerServer

func RegisterTenantHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TenantServer) error

RegisterTenantHandlerServer registers the http handlers for service Tenant to "mux". UnaryRPC :call TenantServer 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 RegisterTenantHandlerFromEndpoint instead.

func RegisterTenantServer

func RegisterTenantServer(s grpc.ServiceRegistrar, srv TenantServer)

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"`
	Tenant  *TenantMeta `protobuf:"bytes,3,opt,name=tenant,proto3" json:"tenant,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) GetTenant

func (x *CreateReply) GetTenant() *TenantMeta

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 {
	Name     string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Describe string `protobuf:"bytes,2,opt,name=describe,proto3" json:"describe,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRequest) Descriptor deprecated

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetDescribe

func (x *CreateRequest) GetDescribe() string

func (*CreateRequest) GetName

func (x *CreateRequest) GetName() string

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 {
	Uuid int32 `protobuf:"varint,1,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) 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"`
	Tenants []*TenantMeta `protobuf:"bytes,3,rep,name=tenants,proto3" json:"tenants,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) GetTenants

func (x *GetReply) GetTenants() []*TenantMeta

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"`
	Uuid  int32  `protobuf:"varint,3,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Name  string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,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) GetName

func (x *GetRequest) GetName() string

func (*GetRequest) GetPage

func (x *GetRequest) GetPage() 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 TenantClient

type TenantClient 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)
}

TenantClient is the client API for Tenant 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 NewTenantClient

func NewTenantClient(cc grpc.ClientConnInterface) TenantClient

type TenantMeta

type TenantMeta struct {
	Uuid       int32                  `protobuf:"varint,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Name       string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Describe   string                 `protobuf:"bytes,3,opt,name=describe,proto3" json:"describe,omitempty"`
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	UpdateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	// contains filtered or unexported fields
}

func (*TenantMeta) Descriptor deprecated

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

Deprecated: Use TenantMeta.ProtoReflect.Descriptor instead.

func (*TenantMeta) GetCreateTime

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

func (*TenantMeta) GetDescribe

func (x *TenantMeta) GetDescribe() string

func (*TenantMeta) GetName

func (x *TenantMeta) GetName() string

func (*TenantMeta) GetUpdateTime

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

func (*TenantMeta) GetUuid

func (x *TenantMeta) GetUuid() int32

func (*TenantMeta) ProtoMessage

func (*TenantMeta) ProtoMessage()

func (*TenantMeta) ProtoReflect

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

func (*TenantMeta) Reset

func (x *TenantMeta) Reset()

func (*TenantMeta) String

func (x *TenantMeta) String() string

type TenantServer

type TenantServer 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
}

TenantServer is the server API for Tenant service. All implementations must embed UnimplementedTenantServer for forward compatibility

type Timestamp

type Timestamp = timestamppb.Timestamp

type UnimplementedTenantServer

type UnimplementedTenantServer struct {
}

UnimplementedTenantServer must be embedded to have forward compatible implementations.

func (UnimplementedTenantServer) Create

func (UnimplementedTenantServer) Delete

func (UnimplementedTenantServer) Get

func (UnimplementedTenantServer) Update

type UnsafeTenantServer

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

UnsafeTenantServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TenantServer 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"`
	Tenant  *TenantMeta `protobuf:"bytes,3,opt,name=tenant,proto3" json:"tenant,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) GetTenant

func (x *UpdateReply) GetTenant() *TenantMeta

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 {
	Uuid     int32  `protobuf:"varint,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Describe string `protobuf:"bytes,3,opt,name=describe,proto3" json:"describe,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateRequest) Descriptor deprecated

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

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetDescribe

func (x *UpdateRequest) GetDescribe() string

func (*UpdateRequest) GetName

func (x *UpdateRequest) GetName() string

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