api_crypto

package
v0.0.0-...-3bc93d9 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 17 Imported by: 3

Documentation

Overview

Package api_crypto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Crypto_CryptoEncrypt_FullMethodName = "/Crypto/CryptoEncrypt"
	Crypto_CryptoDecrypt_FullMethodName = "/Crypto/CryptoDecrypt"
)

Variables

View Source
var Crypto_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Crypto",
	HandlerType: (*CryptoServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CryptoEncrypt",
			Handler:    _Crypto_CryptoEncrypt_Handler,
		},
		{
			MethodName: "CryptoDecrypt",
			Handler:    _Crypto_CryptoDecrypt_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "crypto.proto",
}

Crypto_ServiceDesc is the grpc.ServiceDesc for Crypto 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_crypto_proto protoreflect.FileDescriptor

Functions

func RegisterCryptoHandler

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

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

func RegisterCryptoHandlerClient

func RegisterCryptoHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CryptoClient) error

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

func RegisterCryptoHandlerFromEndpoint

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

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

func RegisterCryptoHandlerServer

func RegisterCryptoHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CryptoServer) error

RegisterCryptoHandlerServer registers the http handlers for service Crypto to "mux". UnaryRPC :call CryptoServer 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 RegisterCryptoHandlerFromEndpoint instead.

func RegisterCryptoServer

func RegisterCryptoServer(s grpc.ServiceRegistrar, srv CryptoServer)

Types

type CryptoClient

type CryptoClient interface {
	CryptoEncrypt(ctx context.Context, in *CryptoEncryptReq, opts ...grpc.CallOption) (*CryptoEncryptResp, error)
	CryptoDecrypt(ctx context.Context, in *CryptoDecryptReq, opts ...grpc.CallOption) (*CryptoDecryptResp, error)
}

CryptoClient is the client API for Crypto 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 NewCryptoClient

func NewCryptoClient(cc grpc.ClientConnInterface) CryptoClient

type CryptoDecryptReq

type CryptoDecryptReq struct {
	Algorithm   string `protobuf:"bytes,1,opt,name=algorithm,proto3" json:"algorithm,omitempty"`
	EncryptText string `protobuf:"bytes,2,opt,name=encryptText,proto3" json:"encryptText,omitempty"`
	// contains filtered or unexported fields
}

func (*CryptoDecryptReq) Descriptor deprecated

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

Deprecated: Use CryptoDecryptReq.ProtoReflect.Descriptor instead.

func (*CryptoDecryptReq) GetAlgorithm

func (x *CryptoDecryptReq) GetAlgorithm() string

func (*CryptoDecryptReq) GetEncryptText

func (x *CryptoDecryptReq) GetEncryptText() string

func (*CryptoDecryptReq) ProtoMessage

func (*CryptoDecryptReq) ProtoMessage()

func (*CryptoDecryptReq) ProtoReflect

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

func (*CryptoDecryptReq) Reset

func (x *CryptoDecryptReq) Reset()

func (*CryptoDecryptReq) String

func (x *CryptoDecryptReq) String() string

type CryptoDecryptResObj

type CryptoDecryptResObj struct {
	PlainText string `protobuf:"bytes,1,opt,name=plainText,proto3" json:"plainText,omitempty"`
	// contains filtered or unexported fields
}

CryptoDecrypt

func (*CryptoDecryptResObj) Descriptor deprecated

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

Deprecated: Use CryptoDecryptResObj.ProtoReflect.Descriptor instead.

func (*CryptoDecryptResObj) GetPlainText

func (x *CryptoDecryptResObj) GetPlainText() string

func (*CryptoDecryptResObj) ProtoMessage

func (*CryptoDecryptResObj) ProtoMessage()

func (*CryptoDecryptResObj) ProtoReflect

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

func (*CryptoDecryptResObj) Reset

func (x *CryptoDecryptResObj) Reset()

func (*CryptoDecryptResObj) String

func (x *CryptoDecryptResObj) String() string

type CryptoDecryptResp

type CryptoDecryptResp struct {
	Code int64                `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg  string               `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Data *CryptoDecryptResObj `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CryptoDecryptResp) Descriptor deprecated

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

Deprecated: Use CryptoDecryptResp.ProtoReflect.Descriptor instead.

func (*CryptoDecryptResp) GetCode

func (x *CryptoDecryptResp) GetCode() int64

func (*CryptoDecryptResp) GetData

func (x *CryptoDecryptResp) GetData() *CryptoDecryptResObj

func (*CryptoDecryptResp) GetMsg

func (x *CryptoDecryptResp) GetMsg() string

func (*CryptoDecryptResp) ProtoMessage

func (*CryptoDecryptResp) ProtoMessage()

func (*CryptoDecryptResp) ProtoReflect

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

func (*CryptoDecryptResp) Reset

func (x *CryptoDecryptResp) Reset()

func (*CryptoDecryptResp) String

func (x *CryptoDecryptResp) String() string

type CryptoEncryptReq

type CryptoEncryptReq struct {
	Algorithm string `protobuf:"bytes,1,opt,name=algorithm,proto3" json:"algorithm,omitempty"`
	PlainText string `protobuf:"bytes,2,opt,name=plainText,proto3" json:"plainText,omitempty"`
	// contains filtered or unexported fields
}

func (*CryptoEncryptReq) Descriptor deprecated

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

Deprecated: Use CryptoEncryptReq.ProtoReflect.Descriptor instead.

func (*CryptoEncryptReq) GetAlgorithm

func (x *CryptoEncryptReq) GetAlgorithm() string

func (*CryptoEncryptReq) GetPlainText

func (x *CryptoEncryptReq) GetPlainText() string

func (*CryptoEncryptReq) ProtoMessage

func (*CryptoEncryptReq) ProtoMessage()

func (*CryptoEncryptReq) ProtoReflect

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

func (*CryptoEncryptReq) Reset

func (x *CryptoEncryptReq) Reset()

func (*CryptoEncryptReq) String

func (x *CryptoEncryptReq) String() string

type CryptoEncryptResObj

type CryptoEncryptResObj struct {
	EncryptText string `protobuf:"bytes,1,opt,name=encryptText,proto3" json:"encryptText,omitempty"`
	// contains filtered or unexported fields
}

CryptoEncrypt

func (*CryptoEncryptResObj) Descriptor deprecated

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

Deprecated: Use CryptoEncryptResObj.ProtoReflect.Descriptor instead.

func (*CryptoEncryptResObj) GetEncryptText

func (x *CryptoEncryptResObj) GetEncryptText() string

func (*CryptoEncryptResObj) ProtoMessage

func (*CryptoEncryptResObj) ProtoMessage()

func (*CryptoEncryptResObj) ProtoReflect

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

func (*CryptoEncryptResObj) Reset

func (x *CryptoEncryptResObj) Reset()

func (*CryptoEncryptResObj) String

func (x *CryptoEncryptResObj) String() string

type CryptoEncryptResp

type CryptoEncryptResp struct {
	Code int64                `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg  string               `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Data *CryptoEncryptResObj `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CryptoEncryptResp) Descriptor deprecated

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

Deprecated: Use CryptoEncryptResp.ProtoReflect.Descriptor instead.

func (*CryptoEncryptResp) GetCode

func (x *CryptoEncryptResp) GetCode() int64

func (*CryptoEncryptResp) GetData

func (x *CryptoEncryptResp) GetData() *CryptoEncryptResObj

func (*CryptoEncryptResp) GetMsg

func (x *CryptoEncryptResp) GetMsg() string

func (*CryptoEncryptResp) ProtoMessage

func (*CryptoEncryptResp) ProtoMessage()

func (*CryptoEncryptResp) ProtoReflect

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

func (*CryptoEncryptResp) Reset

func (x *CryptoEncryptResp) Reset()

func (*CryptoEncryptResp) String

func (x *CryptoEncryptResp) String() string

type CryptoServer

type CryptoServer interface {
	CryptoEncrypt(context.Context, *CryptoEncryptReq) (*CryptoEncryptResp, error)
	CryptoDecrypt(context.Context, *CryptoDecryptReq) (*CryptoDecryptResp, error)
}

CryptoServer is the server API for Crypto service. All implementations should embed UnimplementedCryptoServer for forward compatibility

type UnimplementedCryptoServer

type UnimplementedCryptoServer struct {
}

UnimplementedCryptoServer should be embedded to have forward compatible implementations.

func (UnimplementedCryptoServer) CryptoDecrypt

func (UnimplementedCryptoServer) CryptoEncrypt

type UnsafeCryptoServer

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

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

Jump to

Keyboard shortcuts

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