Documentation ¶
Overview ¶
Package apiV1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterCacosHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCacosHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CacosClient) error
- func RegisterCacosHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCacosHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CacosServer) error
- func RegisterCacosServer(s grpc.ServiceRegistrar, srv CacosServer)
- type AddAppReq
- type AddKVReq
- func (*AddKVReq) Descriptor() ([]byte, []int)deprecated
- func (x *AddKVReq) GetApp() string
- func (x *AddKVReq) GetKey() string
- func (x *AddKVReq) GetNamespace() string
- func (x *AddKVReq) GetVal() string
- func (*AddKVReq) ProtoMessage()
- func (x *AddKVReq) ProtoReflect() protoreflect.Message
- func (x *AddKVReq) Reset()
- func (x *AddKVReq) String() string
- type AddNamespaceReq
- type App
- type AppListReply
- type AppListReq
- type CacosClient
- type CacosServer
- type HelloReply
- type HelloRequest
- type KV
- type KVListReply
- type KVListReq
- type LoginReply
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetPassword() string
- func (x *LoginRequest) GetUsername() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- type Namespace
- type NamespaceListReply
- func (*NamespaceListReply) Descriptor() ([]byte, []int)deprecated
- func (x *NamespaceListReply) GetNamespaceList() []*Namespace
- func (*NamespaceListReply) ProtoMessage()
- func (x *NamespaceListReply) ProtoReflect() protoreflect.Message
- func (x *NamespaceListReply) Reset()
- func (x *NamespaceListReply) String() string
- type NamespaceListReq
- type UnimplementedCacosServer
- func (UnimplementedCacosServer) AddApp(context.Context, *AddAppReq) (*emptypb.Empty, error)
- func (UnimplementedCacosServer) AddKV(context.Context, *AddKVReq) (*emptypb.Empty, error)
- func (UnimplementedCacosServer) AddNamespace(context.Context, *AddNamespaceReq) (*emptypb.Empty, error)
- func (UnimplementedCacosServer) AppList(context.Context, *AppListReq) (*AppListReply, error)
- func (UnimplementedCacosServer) AuthLogin(context.Context, *LoginRequest) (*LoginReply, error)
- func (UnimplementedCacosServer) KvList(context.Context, *KVListReq) (*KVListReply, error)
- func (UnimplementedCacosServer) NamespaceList(context.Context, *emptypb.Empty) (*NamespaceListReply, error)
- func (UnimplementedCacosServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error)
- type UnsafeCacosServer
Constants ¶
This section is empty.
Variables ¶
var Cacos_ServiceDesc = grpc.ServiceDesc{ ServiceName: "apiV1.Cacos", HandlerType: (*CacosServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _Cacos_SayHello_Handler, }, { MethodName: "AuthLogin", Handler: _Cacos_AuthLogin_Handler, }, { MethodName: "NamespaceList", Handler: _Cacos_NamespaceList_Handler, }, { MethodName: "AppList", Handler: _Cacos_AppList_Handler, }, { MethodName: "KvList", Handler: _Cacos_KvList_Handler, }, { MethodName: "AddNamespace", Handler: _Cacos_AddNamespace_Handler, }, { MethodName: "AddApp", Handler: _Cacos_AddApp_Handler, }, { MethodName: "AddKV", Handler: _Cacos_AddKV_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cacos.proto", }
Cacos_ServiceDesc is the grpc.ServiceDesc for Cacos service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_cacos_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCacosHandler ¶
RegisterCacosHandler registers the http handlers for service Cacos to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCacosHandlerClient ¶
func RegisterCacosHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CacosClient) error
RegisterCacosHandlerClient registers the http handlers for service Cacos to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CacosClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CacosClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CacosClient" to call the correct interceptors.
func RegisterCacosHandlerFromEndpoint ¶
func RegisterCacosHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCacosHandlerFromEndpoint is same as RegisterCacosHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCacosHandlerServer ¶
func RegisterCacosHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CacosServer) error
RegisterCacosHandlerServer registers the http handlers for service Cacos to "mux". UnaryRPC :call CacosServer 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 RegisterCacosHandlerFromEndpoint instead.
func RegisterCacosServer ¶
func RegisterCacosServer(s grpc.ServiceRegistrar, srv CacosServer)
Types ¶
type AddAppReq ¶
type AddAppReq struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` App string `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"` // contains filtered or unexported fields }
func (*AddAppReq) Descriptor
deprecated
func (*AddAppReq) GetNamespace ¶
func (*AddAppReq) ProtoMessage ¶
func (*AddAppReq) ProtoMessage()
func (*AddAppReq) ProtoReflect ¶
func (x *AddAppReq) ProtoReflect() protoreflect.Message
type AddKVReq ¶
type AddKVReq struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` App string `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"` Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` Val string `protobuf:"bytes,4,opt,name=val,proto3" json:"val,omitempty"` // contains filtered or unexported fields }
func (*AddKVReq) Descriptor
deprecated
func (*AddKVReq) GetNamespace ¶
func (*AddKVReq) ProtoMessage ¶
func (*AddKVReq) ProtoMessage()
func (*AddKVReq) ProtoReflect ¶
func (x *AddKVReq) ProtoReflect() protoreflect.Message
type AddNamespaceReq ¶
type AddNamespaceReq struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // contains filtered or unexported fields }
func (*AddNamespaceReq) Descriptor
deprecated
func (*AddNamespaceReq) Descriptor() ([]byte, []int)
Deprecated: Use AddNamespaceReq.ProtoReflect.Descriptor instead.
func (*AddNamespaceReq) GetNamespace ¶
func (x *AddNamespaceReq) GetNamespace() string
func (*AddNamespaceReq) ProtoMessage ¶
func (*AddNamespaceReq) ProtoMessage()
func (*AddNamespaceReq) ProtoReflect ¶
func (x *AddNamespaceReq) ProtoReflect() protoreflect.Message
func (*AddNamespaceReq) Reset ¶
func (x *AddNamespaceReq) Reset()
func (*AddNamespaceReq) String ¶
func (x *AddNamespaceReq) String() string
type App ¶
type App struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` App string `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"` // contains filtered or unexported fields }
func (*App) Descriptor
deprecated
func (*App) GetNamespace ¶
func (*App) ProtoMessage ¶
func (*App) ProtoMessage()
func (*App) ProtoReflect ¶
func (x *App) ProtoReflect() protoreflect.Message
type AppListReply ¶
type AppListReply struct { AppList []*App `protobuf:"bytes,1,rep,name=appList,json=app_list,proto3" json:"appList,omitempty"` // contains filtered or unexported fields }
func (*AppListReply) Descriptor
deprecated
func (*AppListReply) Descriptor() ([]byte, []int)
Deprecated: Use AppListReply.ProtoReflect.Descriptor instead.
func (*AppListReply) GetAppList ¶
func (x *AppListReply) GetAppList() []*App
func (*AppListReply) ProtoMessage ¶
func (*AppListReply) ProtoMessage()
func (*AppListReply) ProtoReflect ¶
func (x *AppListReply) ProtoReflect() protoreflect.Message
func (*AppListReply) Reset ¶
func (x *AppListReply) Reset()
func (*AppListReply) String ¶
func (x *AppListReply) String() string
type AppListReq ¶
type AppListReq struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // contains filtered or unexported fields }
func (*AppListReq) Descriptor
deprecated
func (*AppListReq) Descriptor() ([]byte, []int)
Deprecated: Use AppListReq.ProtoReflect.Descriptor instead.
func (*AppListReq) GetNamespace ¶
func (x *AppListReq) GetNamespace() string
func (*AppListReq) ProtoMessage ¶
func (*AppListReq) ProtoMessage()
func (*AppListReq) ProtoReflect ¶
func (x *AppListReq) ProtoReflect() protoreflect.Message
func (*AppListReq) Reset ¶
func (x *AppListReq) Reset()
func (*AppListReq) String ¶
func (x *AppListReq) String() string
type CacosClient ¶
type CacosClient interface { // Sends a greeting SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) AuthLogin(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) NamespaceList(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NamespaceListReply, error) AppList(ctx context.Context, in *AppListReq, opts ...grpc.CallOption) (*AppListReply, error) KvList(ctx context.Context, in *KVListReq, opts ...grpc.CallOption) (*KVListReply, error) AddNamespace(ctx context.Context, in *AddNamespaceReq, opts ...grpc.CallOption) (*emptypb.Empty, error) AddApp(ctx context.Context, in *AddAppReq, opts ...grpc.CallOption) (*emptypb.Empty, error) AddKV(ctx context.Context, in *AddKVReq, opts ...grpc.CallOption) (*emptypb.Empty, error) }
CacosClient is the client API for Cacos 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 NewCacosClient ¶
func NewCacosClient(cc grpc.ClientConnInterface) CacosClient
type CacosServer ¶
type CacosServer interface { // Sends a greeting SayHello(context.Context, *HelloRequest) (*HelloReply, error) AuthLogin(context.Context, *LoginRequest) (*LoginReply, error) NamespaceList(context.Context, *emptypb.Empty) (*NamespaceListReply, error) AppList(context.Context, *AppListReq) (*AppListReply, error) KvList(context.Context, *KVListReq) (*KVListReply, error) AddNamespace(context.Context, *AddNamespaceReq) (*emptypb.Empty, error) AddApp(context.Context, *AddAppReq) (*emptypb.Empty, error) AddKV(context.Context, *AddKVReq) (*emptypb.Empty, error) // contains filtered or unexported methods }
CacosServer is the server API for Cacos service. All implementations must embed UnimplementedCacosServer for forward compatibility
type HelloReply ¶
type HelloReply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
The response message containing the greetings
func (*HelloReply) Descriptor
deprecated
func (*HelloReply) Descriptor() ([]byte, []int)
Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.
func (*HelloReply) GetMessage ¶
func (x *HelloReply) GetMessage() string
func (*HelloReply) ProtoMessage ¶
func (*HelloReply) ProtoMessage()
func (*HelloReply) ProtoReflect ¶
func (x *HelloReply) ProtoReflect() protoreflect.Message
func (*HelloReply) Reset ¶
func (x *HelloReply) Reset()
func (*HelloReply) String ¶
func (x *HelloReply) String() string
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
The request message containing the user's name.
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) GetName ¶
func (x *HelloRequest) GetName() string
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
type KV ¶
type KV struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` App string `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"` Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` Val string `protobuf:"bytes,4,opt,name=val,proto3" json:"val,omitempty"` // contains filtered or unexported fields }
func (*KV) Descriptor
deprecated
func (*KV) GetNamespace ¶
func (*KV) ProtoMessage ¶
func (*KV) ProtoMessage()
func (*KV) ProtoReflect ¶
func (x *KV) ProtoReflect() protoreflect.Message
type KVListReply ¶
type KVListReply struct { KvList []*KV `protobuf:"bytes,1,rep,name=kvList,json=kv_list,proto3" json:"kvList,omitempty"` // contains filtered or unexported fields }
func (*KVListReply) Descriptor
deprecated
func (*KVListReply) Descriptor() ([]byte, []int)
Deprecated: Use KVListReply.ProtoReflect.Descriptor instead.
func (*KVListReply) GetKvList ¶
func (x *KVListReply) GetKvList() []*KV
func (*KVListReply) ProtoMessage ¶
func (*KVListReply) ProtoMessage()
func (*KVListReply) ProtoReflect ¶
func (x *KVListReply) ProtoReflect() protoreflect.Message
func (*KVListReply) Reset ¶
func (x *KVListReply) Reset()
func (*KVListReply) String ¶
func (x *KVListReply) String() string
type KVListReq ¶
type KVListReq struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` App string `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"` // contains filtered or unexported fields }
func (*KVListReq) Descriptor
deprecated
func (*KVListReq) GetNamespace ¶
func (*KVListReq) ProtoMessage ¶
func (*KVListReq) ProtoMessage()
func (*KVListReq) ProtoReflect ¶
func (x *KVListReq) ProtoReflect() protoreflect.Message
type LoginReply ¶
type LoginReply struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*LoginReply) Descriptor
deprecated
func (*LoginReply) Descriptor() ([]byte, []int)
Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.
func (*LoginReply) GetToken ¶
func (x *LoginReply) GetToken() string
func (*LoginReply) ProtoMessage ¶
func (*LoginReply) ProtoMessage()
func (*LoginReply) ProtoReflect ¶
func (x *LoginReply) ProtoReflect() protoreflect.Message
func (*LoginReply) Reset ¶
func (x *LoginReply) Reset()
func (*LoginReply) String ¶
func (x *LoginReply) String() string
type LoginRequest ¶
type LoginRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) GetUsername ¶
func (x *LoginRequest) GetUsername() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type Namespace ¶
type Namespace struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // contains filtered or unexported fields }
func (*Namespace) Descriptor
deprecated
func (*Namespace) GetNamespace ¶
func (*Namespace) ProtoMessage ¶
func (*Namespace) ProtoMessage()
func (*Namespace) ProtoReflect ¶
func (x *Namespace) ProtoReflect() protoreflect.Message
type NamespaceListReply ¶
type NamespaceListReply struct { NamespaceList []*Namespace `protobuf:"bytes,1,rep,name=namespaceList,json=namespace_list,proto3" json:"namespaceList,omitempty"` // contains filtered or unexported fields }
func (*NamespaceListReply) Descriptor
deprecated
func (*NamespaceListReply) Descriptor() ([]byte, []int)
Deprecated: Use NamespaceListReply.ProtoReflect.Descriptor instead.
func (*NamespaceListReply) GetNamespaceList ¶
func (x *NamespaceListReply) GetNamespaceList() []*Namespace
func (*NamespaceListReply) ProtoMessage ¶
func (*NamespaceListReply) ProtoMessage()
func (*NamespaceListReply) ProtoReflect ¶
func (x *NamespaceListReply) ProtoReflect() protoreflect.Message
func (*NamespaceListReply) Reset ¶
func (x *NamespaceListReply) Reset()
func (*NamespaceListReply) String ¶
func (x *NamespaceListReply) String() string
type NamespaceListReq ¶
type NamespaceListReq struct {
// contains filtered or unexported fields
}
func (*NamespaceListReq) Descriptor
deprecated
func (*NamespaceListReq) Descriptor() ([]byte, []int)
Deprecated: Use NamespaceListReq.ProtoReflect.Descriptor instead.
func (*NamespaceListReq) ProtoMessage ¶
func (*NamespaceListReq) ProtoMessage()
func (*NamespaceListReq) ProtoReflect ¶
func (x *NamespaceListReq) ProtoReflect() protoreflect.Message
func (*NamespaceListReq) Reset ¶
func (x *NamespaceListReq) Reset()
func (*NamespaceListReq) String ¶
func (x *NamespaceListReq) String() string
type UnimplementedCacosServer ¶
type UnimplementedCacosServer struct { }
UnimplementedCacosServer must be embedded to have forward compatible implementations.
func (UnimplementedCacosServer) AddNamespace ¶
func (UnimplementedCacosServer) AddNamespace(context.Context, *AddNamespaceReq) (*emptypb.Empty, error)
func (UnimplementedCacosServer) AppList ¶
func (UnimplementedCacosServer) AppList(context.Context, *AppListReq) (*AppListReply, error)
func (UnimplementedCacosServer) AuthLogin ¶
func (UnimplementedCacosServer) AuthLogin(context.Context, *LoginRequest) (*LoginReply, error)
func (UnimplementedCacosServer) KvList ¶
func (UnimplementedCacosServer) KvList(context.Context, *KVListReq) (*KVListReply, error)
func (UnimplementedCacosServer) NamespaceList ¶
func (UnimplementedCacosServer) NamespaceList(context.Context, *emptypb.Empty) (*NamespaceListReply, error)
func (UnimplementedCacosServer) SayHello ¶
func (UnimplementedCacosServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error)
type UnsafeCacosServer ¶
type UnsafeCacosServer interface {
// contains filtered or unexported methods
}
UnsafeCacosServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CacosServer will result in compilation errors.