apiV1

package
v0.0.0-...-fa62366 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package apiV1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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)

View Source
var File_cacos_proto protoreflect.FileDescriptor

Functions

func RegisterCacosHandler

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

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) Descriptor() ([]byte, []int)

Deprecated: Use AddAppReq.ProtoReflect.Descriptor instead.

func (*AddAppReq) GetApp

func (x *AddAppReq) GetApp() string

func (*AddAppReq) GetNamespace

func (x *AddAppReq) GetNamespace() string

func (*AddAppReq) ProtoMessage

func (*AddAppReq) ProtoMessage()

func (*AddAppReq) ProtoReflect

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

func (*AddAppReq) Reset

func (x *AddAppReq) Reset()

func (*AddAppReq) String

func (x *AddAppReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use AddKVReq.ProtoReflect.Descriptor instead.

func (*AddKVReq) GetApp

func (x *AddKVReq) GetApp() string

func (*AddKVReq) GetKey

func (x *AddKVReq) GetKey() string

func (*AddKVReq) GetNamespace

func (x *AddKVReq) GetNamespace() string

func (*AddKVReq) GetVal

func (x *AddKVReq) GetVal() string

func (*AddKVReq) ProtoMessage

func (*AddKVReq) ProtoMessage()

func (*AddKVReq) ProtoReflect

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

func (*AddKVReq) Reset

func (x *AddKVReq) Reset()

func (*AddKVReq) String

func (x *AddKVReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use App.ProtoReflect.Descriptor instead.

func (*App) GetApp

func (x *App) GetApp() string

func (*App) GetNamespace

func (x *App) GetNamespace() string

func (*App) ProtoMessage

func (*App) ProtoMessage()

func (*App) ProtoReflect

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

func (*App) Reset

func (x *App) Reset()

func (*App) String

func (x *App) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use KV.ProtoReflect.Descriptor instead.

func (*KV) GetApp

func (x *KV) GetApp() string

func (*KV) GetKey

func (x *KV) GetKey() string

func (*KV) GetNamespace

func (x *KV) GetNamespace() string

func (*KV) GetVal

func (x *KV) GetVal() string

func (*KV) ProtoMessage

func (*KV) ProtoMessage()

func (*KV) ProtoReflect

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

func (*KV) Reset

func (x *KV) Reset()

func (*KV) String

func (x *KV) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use KVListReq.ProtoReflect.Descriptor instead.

func (*KVListReq) GetApp

func (x *KVListReq) GetApp() string

func (*KVListReq) GetNamespace

func (x *KVListReq) GetNamespace() string

func (*KVListReq) ProtoMessage

func (*KVListReq) ProtoMessage()

func (*KVListReq) ProtoReflect

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

func (*KVListReq) Reset

func (x *KVListReq) Reset()

func (*KVListReq) String

func (x *KVListReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Namespace.ProtoReflect.Descriptor instead.

func (*Namespace) GetNamespace

func (x *Namespace) GetNamespace() string

func (*Namespace) ProtoMessage

func (*Namespace) ProtoMessage()

func (*Namespace) ProtoReflect

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

func (*Namespace) Reset

func (x *Namespace) Reset()

func (*Namespace) String

func (x *Namespace) String() string

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) AddApp

func (UnimplementedCacosServer) AddKV

func (UnimplementedCacosServer) AddNamespace

func (UnimplementedCacosServer) AppList

func (UnimplementedCacosServer) AuthLogin

func (UnimplementedCacosServer) KvList

func (UnimplementedCacosServer) NamespaceList

func (UnimplementedCacosServer) SayHello

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.

Jump to

Keyboard shortcuts

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