message

package
v0.0.0-...-a0d1ad3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package message is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_proto_v1alpha1_message_message_proto protoreflect.FileDescriptor
View Source
var Messages_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hvx.api.v1alpha1.message.proto.Messages",
	HandlerType: (*MessagesServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AccessRegister",
			Handler:    _Messages_AccessRegister_Handler,
		},
		{
			MethodName: "AccessLogin",
			Handler:    _Messages_AccessLogin_Handler,
		},
		{
			MethodName: "AccessDelete",
			Handler:    _Messages_AccessDelete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/v1alpha1/message/message.proto",
}

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

Functions

func RegisterMessagesHandler

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

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

func RegisterMessagesHandlerClient

func RegisterMessagesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MessagesClient) error

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

func RegisterMessagesHandlerFromEndpoint

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

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

func RegisterMessagesHandlerServer

func RegisterMessagesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MessagesServer) error

RegisterMessagesHandlerServer registers the http handlers for service Messages to "mux". UnaryRPC :call MessagesServer 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 RegisterMessagesHandlerFromEndpoint instead.

func RegisterMessagesServer

func RegisterMessagesServer(s grpc.ServiceRegistrar, srv MessagesServer)

Types

type AccessDeleteRequest

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

func (*AccessDeleteRequest) Descriptor deprecated

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

Deprecated: Use AccessDeleteRequest.ProtoReflect.Descriptor instead.

func (*AccessDeleteRequest) GetPassword

func (x *AccessDeleteRequest) GetPassword() string

func (*AccessDeleteRequest) ProtoMessage

func (*AccessDeleteRequest) ProtoMessage()

func (*AccessDeleteRequest) ProtoReflect

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

func (*AccessDeleteRequest) Reset

func (x *AccessDeleteRequest) Reset()

func (*AccessDeleteRequest) String

func (x *AccessDeleteRequest) String() string

type AccessDeleteResponse

type AccessDeleteResponse struct {
	Code   string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessDeleteResponse) Descriptor deprecated

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

Deprecated: Use AccessDeleteResponse.ProtoReflect.Descriptor instead.

func (*AccessDeleteResponse) GetCode

func (x *AccessDeleteResponse) GetCode() string

func (*AccessDeleteResponse) GetStatus

func (x *AccessDeleteResponse) GetStatus() string

func (*AccessDeleteResponse) ProtoMessage

func (*AccessDeleteResponse) ProtoMessage()

func (*AccessDeleteResponse) ProtoReflect

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

func (*AccessDeleteResponse) Reset

func (x *AccessDeleteResponse) Reset()

func (*AccessDeleteResponse) String

func (x *AccessDeleteResponse) String() string

type AccessLoginRequest

type AccessLoginRequest struct {
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessLoginRequest) Descriptor deprecated

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

Deprecated: Use AccessLoginRequest.ProtoReflect.Descriptor instead.

func (*AccessLoginRequest) GetPassword

func (x *AccessLoginRequest) GetPassword() string

func (*AccessLoginRequest) GetUsername

func (x *AccessLoginRequest) GetUsername() string

func (*AccessLoginRequest) ProtoMessage

func (*AccessLoginRequest) ProtoMessage()

func (*AccessLoginRequest) ProtoReflect

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

func (*AccessLoginRequest) Reset

func (x *AccessLoginRequest) Reset()

func (*AccessLoginRequest) String

func (x *AccessLoginRequest) String() string

type AccessLoginResponse

type AccessLoginResponse struct {
	Code   string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessLoginResponse) Descriptor deprecated

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

Deprecated: Use AccessLoginResponse.ProtoReflect.Descriptor instead.

func (*AccessLoginResponse) GetCode

func (x *AccessLoginResponse) GetCode() string

func (*AccessLoginResponse) GetStatus

func (x *AccessLoginResponse) GetStatus() string

func (*AccessLoginResponse) ProtoMessage

func (*AccessLoginResponse) ProtoMessage()

func (*AccessLoginResponse) ProtoReflect

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

func (*AccessLoginResponse) Reset

func (x *AccessLoginResponse) Reset()

func (*AccessLoginResponse) String

func (x *AccessLoginResponse) String() string

type AccessRegisterRequest

type AccessRegisterRequest struct {
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessRegisterRequest) Descriptor deprecated

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

Deprecated: Use AccessRegisterRequest.ProtoReflect.Descriptor instead.

func (*AccessRegisterRequest) GetPassword

func (x *AccessRegisterRequest) GetPassword() string

func (*AccessRegisterRequest) GetUsername

func (x *AccessRegisterRequest) GetUsername() string

func (*AccessRegisterRequest) ProtoMessage

func (*AccessRegisterRequest) ProtoMessage()

func (*AccessRegisterRequest) ProtoReflect

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

func (*AccessRegisterRequest) Reset

func (x *AccessRegisterRequest) Reset()

func (*AccessRegisterRequest) String

func (x *AccessRegisterRequest) String() string

type AccessRegisterResponse

type AccessRegisterResponse struct {
	Code        string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	Status      string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	AccessToken string `protobuf:"bytes,3,opt,name=accessToken,proto3" json:"accessToken,omitempty"`
	UserId      string `protobuf:"bytes,4,opt,name=userId,proto3" json:"userId,omitempty"`
	BaseUrl     string `protobuf:"bytes,5,opt,name=baseUrl,proto3" json:"baseUrl,omitempty"`
	DeviceId    string `protobuf:"bytes,6,opt,name=deviceId,proto3" json:"deviceId,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessRegisterResponse) Descriptor deprecated

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

Deprecated: Use AccessRegisterResponse.ProtoReflect.Descriptor instead.

func (*AccessRegisterResponse) GetAccessToken

func (x *AccessRegisterResponse) GetAccessToken() string

func (*AccessRegisterResponse) GetBaseUrl

func (x *AccessRegisterResponse) GetBaseUrl() string

func (*AccessRegisterResponse) GetCode

func (x *AccessRegisterResponse) GetCode() string

func (*AccessRegisterResponse) GetDeviceId

func (x *AccessRegisterResponse) GetDeviceId() string

func (*AccessRegisterResponse) GetStatus

func (x *AccessRegisterResponse) GetStatus() string

func (*AccessRegisterResponse) GetUserId

func (x *AccessRegisterResponse) GetUserId() string

func (*AccessRegisterResponse) ProtoMessage

func (*AccessRegisterResponse) ProtoMessage()

func (*AccessRegisterResponse) ProtoReflect

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

func (*AccessRegisterResponse) Reset

func (x *AccessRegisterResponse) Reset()

func (*AccessRegisterResponse) String

func (x *AccessRegisterResponse) String() string

type MessagesClient

type MessagesClient interface {
	// AccessRegister Register a matrix account with a username and password.
	// will be registered using the matrix.org API.
	AccessRegister(ctx context.Context, in *AccessRegisterRequest, opts ...grpc.CallOption) (*AccessRegisterResponse, error)
	// AccessLogin Sometimes you need to log in again when the token
	// is wrong or when you reauthorize.
	AccessLogin(ctx context.Context, in *AccessLoginRequest, opts ...grpc.CallOption) (*AccessLoginResponse, error)
	// AccessDelete Delete a matrix account by its account id.
	AccessDelete(ctx context.Context, in *AccessDeleteRequest, opts ...grpc.CallOption) (*AccessDeleteResponse, error)
}

MessagesClient is the client API for Messages 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 NewMessagesClient

func NewMessagesClient(cc grpc.ClientConnInterface) MessagesClient

type MessagesServer

type MessagesServer interface {
	// AccessRegister Register a matrix account with a username and password.
	// will be registered using the matrix.org API.
	AccessRegister(context.Context, *AccessRegisterRequest) (*AccessRegisterResponse, error)
	// AccessLogin Sometimes you need to log in again when the token
	// is wrong or when you reauthorize.
	AccessLogin(context.Context, *AccessLoginRequest) (*AccessLoginResponse, error)
	// AccessDelete Delete a matrix account by its account id.
	AccessDelete(context.Context, *AccessDeleteRequest) (*AccessDeleteResponse, error)
}

MessagesServer is the server API for Messages service. All implementations should embed UnimplementedMessagesServer for forward compatibility

type UnimplementedMessagesServer

type UnimplementedMessagesServer struct {
}

UnimplementedMessagesServer should be embedded to have forward compatible implementations.

func (UnimplementedMessagesServer) AccessDelete

func (UnimplementedMessagesServer) AccessLogin

func (UnimplementedMessagesServer) AccessRegister

type UnsafeMessagesServer

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

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

Jump to

Keyboard shortcuts

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