sdk

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package sdk is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ProxyService_AddClient_FullMethodName     = "/sdk.ProxyService/AddClient"
	ProxyService_AddClientList_FullMethodName = "/sdk.ProxyService/AddClientList"
	ProxyService_RemoveClient_FullMethodName  = "/sdk.ProxyService/RemoveClient"
)

Variables

View Source
var File_proxy_proto protoreflect.FileDescriptor
View Source
var ProxyService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sdk.ProxyService",
	HandlerType: (*ProxyServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddClient",
			Handler:    _ProxyService_AddClient_Handler,
		},
		{
			MethodName: "AddClientList",
			Handler:    _ProxyService_AddClientList_Handler,
		},
		{
			MethodName: "RemoveClient",
			Handler:    _ProxyService_RemoveClient_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proxy.proto",
}

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

Functions

func RegisterProxyServiceHandler

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

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

func RegisterProxyServiceHandlerClient

func RegisterProxyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProxyServiceClient) error

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

func RegisterProxyServiceHandlerFromEndpoint

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

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

func RegisterProxyServiceHandlerServer

func RegisterProxyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProxyServiceServer) error

RegisterProxyServiceHandlerServer registers the http handlers for service ProxyService to "mux". UnaryRPC :call ProxyServiceServer 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 RegisterProxyServiceHandlerFromEndpoint instead.

func RegisterProxyServiceServer

func RegisterProxyServiceServer(s grpc.ServiceRegistrar, srv ProxyServiceServer)

Types

type AddClientListRequest

type AddClientListRequest struct {
	Items []*AddClientRequest `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*AddClientListRequest) Descriptor deprecated

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

Deprecated: Use AddClientListRequest.ProtoReflect.Descriptor instead.

func (*AddClientListRequest) GetItems

func (x *AddClientListRequest) GetItems() []*AddClientRequest

func (*AddClientListRequest) ProtoMessage

func (*AddClientListRequest) ProtoMessage()

func (*AddClientListRequest) ProtoReflect

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

func (*AddClientListRequest) Reset

func (x *AddClientListRequest) Reset()

func (*AddClientListRequest) String

func (x *AddClientListRequest) String() string

type AddClientListResponse

type AddClientListResponse struct {
	// contains filtered or unexported fields
}

func (*AddClientListResponse) Descriptor deprecated

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

Deprecated: Use AddClientListResponse.ProtoReflect.Descriptor instead.

func (*AddClientListResponse) ProtoMessage

func (*AddClientListResponse) ProtoMessage()

func (*AddClientListResponse) ProtoReflect

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

func (*AddClientListResponse) Reset

func (x *AddClientListResponse) Reset()

func (*AddClientListResponse) String

func (x *AddClientListResponse) String() string

type AddClientRequest

type AddClientRequest struct {
	IpAddress string `protobuf:"bytes,1,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty" validate:"required,ip"`
	PublicKey string `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" validate:"required"`
	// contains filtered or unexported fields
}

func (*AddClientRequest) Descriptor deprecated

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

Deprecated: Use AddClientRequest.ProtoReflect.Descriptor instead.

func (*AddClientRequest) GetIpAddress

func (x *AddClientRequest) GetIpAddress() string

func (*AddClientRequest) GetPublicKey

func (x *AddClientRequest) GetPublicKey() string

func (*AddClientRequest) ProtoMessage

func (*AddClientRequest) ProtoMessage()

func (*AddClientRequest) ProtoReflect

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

func (*AddClientRequest) Reset

func (x *AddClientRequest) Reset()

func (*AddClientRequest) String

func (x *AddClientRequest) String() string

type AddClientResponse

type AddClientResponse struct {
	// contains filtered or unexported fields
}

func (*AddClientResponse) Descriptor deprecated

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

Deprecated: Use AddClientResponse.ProtoReflect.Descriptor instead.

func (*AddClientResponse) ProtoMessage

func (*AddClientResponse) ProtoMessage()

func (*AddClientResponse) ProtoReflect

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

func (*AddClientResponse) Reset

func (x *AddClientResponse) Reset()

func (*AddClientResponse) String

func (x *AddClientResponse) String() string

type ProxyServiceClient

type ProxyServiceClient interface {
	AddClient(ctx context.Context, in *AddClientRequest, opts ...grpc.CallOption) (*AddClientResponse, error)
	AddClientList(ctx context.Context, in *AddClientListRequest, opts ...grpc.CallOption) (*AddClientListResponse, error)
	RemoveClient(ctx context.Context, in *RemoveClientRequest, opts ...grpc.CallOption) (*RemoveClientResponse, error)
}

ProxyServiceClient is the client API for ProxyService 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.

type ProxyServiceServer

type ProxyServiceServer interface {
	AddClient(context.Context, *AddClientRequest) (*AddClientResponse, error)
	AddClientList(context.Context, *AddClientListRequest) (*AddClientListResponse, error)
	RemoveClient(context.Context, *RemoveClientRequest) (*RemoveClientResponse, error)
	// contains filtered or unexported methods
}

ProxyServiceServer is the server API for ProxyService service. All implementations must embed UnimplementedProxyServiceServer for forward compatibility

type RemoveClientRequest

type RemoveClientRequest struct {
	IpAddress string `protobuf:"bytes,1,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty" validate:"required,ip"`
	PublicKey string `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" validate:"required"`
	// contains filtered or unexported fields
}

func (*RemoveClientRequest) Descriptor deprecated

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

Deprecated: Use RemoveClientRequest.ProtoReflect.Descriptor instead.

func (*RemoveClientRequest) GetIpAddress

func (x *RemoveClientRequest) GetIpAddress() string

func (*RemoveClientRequest) GetPublicKey

func (x *RemoveClientRequest) GetPublicKey() string

func (*RemoveClientRequest) ProtoMessage

func (*RemoveClientRequest) ProtoMessage()

func (*RemoveClientRequest) ProtoReflect

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

func (*RemoveClientRequest) Reset

func (x *RemoveClientRequest) Reset()

func (*RemoveClientRequest) String

func (x *RemoveClientRequest) String() string

type RemoveClientResponse

type RemoveClientResponse struct {
	// contains filtered or unexported fields
}

func (*RemoveClientResponse) Descriptor deprecated

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

Deprecated: Use RemoveClientResponse.ProtoReflect.Descriptor instead.

func (*RemoveClientResponse) ProtoMessage

func (*RemoveClientResponse) ProtoMessage()

func (*RemoveClientResponse) ProtoReflect

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

func (*RemoveClientResponse) Reset

func (x *RemoveClientResponse) Reset()

func (*RemoveClientResponse) String

func (x *RemoveClientResponse) String() string

type UnimplementedProxyServiceServer

type UnimplementedProxyServiceServer struct {
}

UnimplementedProxyServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedProxyServiceServer) AddClient

func (UnimplementedProxyServiceServer) AddClientList

func (UnimplementedProxyServiceServer) RemoveClient

type UnsafeProxyServiceServer

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

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

Jump to

Keyboard shortcuts

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