app

package module
v0.0.0-...-93824ef Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Package app is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package app is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AuthService_Login_FullMethodName  = "/icuc.im.app.AuthService/Login"
	AuthService_Logout_FullMethodName = "/icuc.im.app.AuthService/Logout"
)
View Source
const (
	MessageService_SingleMessage_FullMethodName = "/icuc.im.app.MessageService/SingleMessage"
	MessageService_GroupMessage_FullMethodName  = "/icuc.im.app.MessageService/GroupMessage"
	MessageService_ImageMessage_FullMethodName  = "/icuc.im.app.MessageService/ImageMessage"
	MessageService_FileMessage_FullMethodName   = "/icuc.im.app.MessageService/FileMessage"
)

Variables

View Source
var AuthService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "icuc.im.app.AuthService",
	HandlerType: (*AuthServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Login",
			Handler:    _AuthService_Login_Handler,
		},
		{
			MethodName: "Logout",
			Handler:    _AuthService_Logout_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "im/app/auth_service.proto",
}

AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService 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_im_app_auth_service_proto protoreflect.FileDescriptor
View Source
var File_im_app_message_service_proto protoreflect.FileDescriptor
View Source
var MessageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "icuc.im.app.MessageService",
	HandlerType: (*MessageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SingleMessage",
			Handler:    _MessageService_SingleMessage_Handler,
		},
		{
			MethodName: "GroupMessage",
			Handler:    _MessageService_GroupMessage_Handler,
		},
		{
			MethodName: "ImageMessage",
			Handler:    _MessageService_ImageMessage_Handler,
		},
		{
			MethodName: "FileMessage",
			Handler:    _MessageService_FileMessage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "im/app/message_service.proto",
}

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

Functions

func RegisterAuthServiceHandler

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

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

func RegisterAuthServiceHandlerClient

func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error

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

func RegisterAuthServiceHandlerFromEndpoint

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

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

func RegisterAuthServiceHandlerServer

func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error

RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". UnaryRPC :call AuthServiceServer 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 RegisterAuthServiceHandlerFromEndpoint instead.

func RegisterAuthServiceServer

func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)

func RegisterMessageServiceHandler

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

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

func RegisterMessageServiceHandlerClient

func RegisterMessageServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MessageServiceClient) error

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

func RegisterMessageServiceHandlerFromEndpoint

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

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

func RegisterMessageServiceHandlerServer

func RegisterMessageServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MessageServiceServer) error

RegisterMessageServiceHandlerServer registers the http handlers for service MessageService to "mux". UnaryRPC :call MessageServiceServer 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 RegisterMessageServiceHandlerFromEndpoint instead.

func RegisterMessageServiceServer

func RegisterMessageServiceServer(s grpc.ServiceRegistrar, srv MessageServiceServer)

Types

type AuthServiceClient

type AuthServiceClient interface {
	// 登入
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
	// 登出
	Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
}

AuthServiceClient is the client API for AuthService 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 AuthServiceServer

type AuthServiceServer interface {
	// 登入
	Login(context.Context, *LoginRequest) (*LoginResponse, error)
	// 登出
	Logout(context.Context, *LogoutRequest) (*LogoutResponse, error)
	// contains filtered or unexported methods
}

AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility

type FileMessageRequest

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

func (*FileMessageRequest) Descriptor deprecated

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

Deprecated: Use FileMessageRequest.ProtoReflect.Descriptor instead.

func (*FileMessageRequest) ProtoMessage

func (*FileMessageRequest) ProtoMessage()

func (*FileMessageRequest) ProtoReflect

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

func (*FileMessageRequest) Reset

func (x *FileMessageRequest) Reset()

func (*FileMessageRequest) String

func (x *FileMessageRequest) String() string

type FileMessageResponse

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

func (*FileMessageResponse) Descriptor deprecated

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

Deprecated: Use FileMessageResponse.ProtoReflect.Descriptor instead.

func (*FileMessageResponse) ProtoMessage

func (*FileMessageResponse) ProtoMessage()

func (*FileMessageResponse) ProtoReflect

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

func (*FileMessageResponse) Reset

func (x *FileMessageResponse) Reset()

func (*FileMessageResponse) String

func (x *FileMessageResponse) String() string

type GroupMessageRequest

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

func (*GroupMessageRequest) Descriptor deprecated

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

Deprecated: Use GroupMessageRequest.ProtoReflect.Descriptor instead.

func (*GroupMessageRequest) ProtoMessage

func (*GroupMessageRequest) ProtoMessage()

func (*GroupMessageRequest) ProtoReflect

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

func (*GroupMessageRequest) Reset

func (x *GroupMessageRequest) Reset()

func (*GroupMessageRequest) String

func (x *GroupMessageRequest) String() string

type GroupMessageResponse

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

func (*GroupMessageResponse) Descriptor deprecated

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

Deprecated: Use GroupMessageResponse.ProtoReflect.Descriptor instead.

func (*GroupMessageResponse) ProtoMessage

func (*GroupMessageResponse) ProtoMessage()

func (*GroupMessageResponse) ProtoReflect

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

func (*GroupMessageResponse) Reset

func (x *GroupMessageResponse) Reset()

func (*GroupMessageResponse) String

func (x *GroupMessageResponse) String() string

type ImageMessageRequest

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

func (*ImageMessageRequest) Descriptor deprecated

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

Deprecated: Use ImageMessageRequest.ProtoReflect.Descriptor instead.

func (*ImageMessageRequest) ProtoMessage

func (*ImageMessageRequest) ProtoMessage()

func (*ImageMessageRequest) ProtoReflect

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

func (*ImageMessageRequest) Reset

func (x *ImageMessageRequest) Reset()

func (*ImageMessageRequest) String

func (x *ImageMessageRequest) String() string

type ImageMessageResponse

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

func (*ImageMessageResponse) Descriptor deprecated

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

Deprecated: Use ImageMessageResponse.ProtoReflect.Descriptor instead.

func (*ImageMessageResponse) ProtoMessage

func (*ImageMessageResponse) ProtoMessage()

func (*ImageMessageResponse) ProtoReflect

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

func (*ImageMessageResponse) Reset

func (x *ImageMessageResponse) Reset()

func (*ImageMessageResponse) String

func (x *ImageMessageResponse) String() string

type LoginRequest

type LoginRequest struct {
	LoginType    uint32        `protobuf:"varint,1,opt,name=LoginType,proto3" json:"LoginType,omitempty"`      // 登录类型,1用户名密码登录,2 oauth登录
	UserPassInfo *UserPassInfo `protobuf:"bytes,2,opt,name=UserPassInfo,proto3" json:"UserPassInfo,omitempty"` // 用户名密码等信息
	OauthInfo    *OauthInfo    `protobuf:"bytes,3,opt,name=OauthInfo,proto3" json:"OauthInfo,omitempty"`       // oauth登录的信息
	Platform     string        `protobuf:"bytes,4,opt,name=Platform,proto3" json:"Platform,omitempty"`         // 设备类型
	// contains filtered or unexported fields
}

func (*LoginRequest) Descriptor deprecated

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

Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.

func (*LoginRequest) GetLoginType

func (x *LoginRequest) GetLoginType() uint32

func (*LoginRequest) GetOauthInfo

func (x *LoginRequest) GetOauthInfo() *OauthInfo

func (*LoginRequest) GetPlatform

func (x *LoginRequest) GetPlatform() string

func (*LoginRequest) GetUserPassInfo

func (x *LoginRequest) GetUserPassInfo() *UserPassInfo

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 LoginResponse

type LoginResponse struct {
	AccessToken string `protobuf:"bytes,1,opt,name=AccessToken,proto3" json:"AccessToken,omitempty"` // 登录成功返回的access_token
	Expire      uint32 `protobuf:"varint,2,opt,name=Expire,proto3" json:"Expire,omitempty"`          // access_token过期时间,单位秒
	// contains filtered or unexported fields
}

func (*LoginResponse) Descriptor deprecated

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

Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.

func (*LoginResponse) GetAccessToken

func (x *LoginResponse) GetAccessToken() string

func (*LoginResponse) GetExpire

func (x *LoginResponse) GetExpire() uint32

func (*LoginResponse) ProtoMessage

func (*LoginResponse) ProtoMessage()

func (*LoginResponse) ProtoReflect

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

func (*LoginResponse) Reset

func (x *LoginResponse) Reset()

func (*LoginResponse) String

func (x *LoginResponse) String() string

type LogoutRequest

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

func (*LogoutRequest) Descriptor deprecated

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

Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.

func (*LogoutRequest) ProtoMessage

func (*LogoutRequest) ProtoMessage()

func (*LogoutRequest) ProtoReflect

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

func (*LogoutRequest) Reset

func (x *LogoutRequest) Reset()

func (*LogoutRequest) String

func (x *LogoutRequest) String() string

type LogoutResponse

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

func (*LogoutResponse) Descriptor deprecated

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

Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead.

func (*LogoutResponse) ProtoMessage

func (*LogoutResponse) ProtoMessage()

func (*LogoutResponse) ProtoReflect

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

func (*LogoutResponse) Reset

func (x *LogoutResponse) Reset()

func (*LogoutResponse) String

func (x *LogoutResponse) String() string

type MessageServiceClient

type MessageServiceClient interface {
	// 单人消息
	SingleMessage(ctx context.Context, in *SingleMessageRequest, opts ...grpc.CallOption) (*SingleMessageResponse, error)
	// 群消息
	GroupMessage(ctx context.Context, in *GroupMessageRequest, opts ...grpc.CallOption) (*GroupMessageResponse, error)
	// 图片消息
	ImageMessage(ctx context.Context, in *ImageMessageRequest, opts ...grpc.CallOption) (*ImageMessageResponse, error)
	// 文件消息
	FileMessage(ctx context.Context, in *FileMessageRequest, opts ...grpc.CallOption) (*FileMessageResponse, error)
}

MessageServiceClient is the client API for MessageService 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 MessageServiceServer

type MessageServiceServer interface {
	// 单人消息
	SingleMessage(context.Context, *SingleMessageRequest) (*SingleMessageResponse, error)
	// 群消息
	GroupMessage(context.Context, *GroupMessageRequest) (*GroupMessageResponse, error)
	// 图片消息
	ImageMessage(context.Context, *ImageMessageRequest) (*ImageMessageResponse, error)
	// 文件消息
	FileMessage(context.Context, *FileMessageRequest) (*FileMessageResponse, error)
	// contains filtered or unexported methods
}

MessageServiceServer is the server API for MessageService service. All implementations must embed UnimplementedMessageServiceServer for forward compatibility

type OauthInfo

type OauthInfo struct {
	Type  uint32 `protobuf:"varint,1,opt,name=Type,proto3" json:"Type,omitempty"`  // oauth的类型,1 微信
	Token string `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,omitempty"` // oauth的token信息
	// contains filtered or unexported fields
}

func (*OauthInfo) Descriptor deprecated

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

Deprecated: Use OauthInfo.ProtoReflect.Descriptor instead.

func (*OauthInfo) GetToken

func (x *OauthInfo) GetToken() string

func (*OauthInfo) GetType

func (x *OauthInfo) GetType() uint32

func (*OauthInfo) ProtoMessage

func (*OauthInfo) ProtoMessage()

func (*OauthInfo) ProtoReflect

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

func (*OauthInfo) Reset

func (x *OauthInfo) Reset()

func (*OauthInfo) String

func (x *OauthInfo) String() string

type SingleMessageRequest

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

func (*SingleMessageRequest) Descriptor deprecated

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

Deprecated: Use SingleMessageRequest.ProtoReflect.Descriptor instead.

func (*SingleMessageRequest) ProtoMessage

func (*SingleMessageRequest) ProtoMessage()

func (*SingleMessageRequest) ProtoReflect

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

func (*SingleMessageRequest) Reset

func (x *SingleMessageRequest) Reset()

func (*SingleMessageRequest) String

func (x *SingleMessageRequest) String() string

type SingleMessageResponse

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

func (*SingleMessageResponse) Descriptor deprecated

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

Deprecated: Use SingleMessageResponse.ProtoReflect.Descriptor instead.

func (*SingleMessageResponse) ProtoMessage

func (*SingleMessageResponse) ProtoMessage()

func (*SingleMessageResponse) ProtoReflect

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

func (*SingleMessageResponse) Reset

func (x *SingleMessageResponse) Reset()

func (*SingleMessageResponse) String

func (x *SingleMessageResponse) String() string

type UnimplementedAuthServiceServer

type UnimplementedAuthServiceServer struct {
}

UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServiceServer) Login

func (UnimplementedAuthServiceServer) Logout

type UnimplementedMessageServiceServer

type UnimplementedMessageServiceServer struct {
}

UnimplementedMessageServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedMessageServiceServer) FileMessage

func (UnimplementedMessageServiceServer) GroupMessage

func (UnimplementedMessageServiceServer) ImageMessage

func (UnimplementedMessageServiceServer) SingleMessage

type UnsafeAuthServiceServer

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

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

type UnsafeMessageServiceServer

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

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

type UserPassInfo

type UserPassInfo 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"`     // 登录密码
	DeviceName string `protobuf:"bytes,3,opt,name=DeviceName,proto3" json:"DeviceName,omitempty"` // 设备名字
	// contains filtered or unexported fields
}

func (*UserPassInfo) Descriptor deprecated

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

Deprecated: Use UserPassInfo.ProtoReflect.Descriptor instead.

func (*UserPassInfo) GetDeviceName

func (x *UserPassInfo) GetDeviceName() string

func (*UserPassInfo) GetPassword

func (x *UserPassInfo) GetPassword() string

func (*UserPassInfo) GetUserName

func (x *UserPassInfo) GetUserName() string

func (*UserPassInfo) ProtoMessage

func (*UserPassInfo) ProtoMessage()

func (*UserPassInfo) ProtoReflect

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

func (*UserPassInfo) Reset

func (x *UserPassInfo) Reset()

func (*UserPassInfo) String

func (x *UserPassInfo) String() string

Jump to

Keyboard shortcuts

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