user

package
v0.0.0-...-a0b9aba Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package user is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_github_com_gen95mis_messenger_protobuf_user_user_proto protoreflect.FileDescriptor

Functions

func RegisterUserHandler

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

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

func RegisterUserHandlerClient

func RegisterUserHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserClient) error

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

func RegisterUserHandlerFromEndpoint

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

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

func RegisterUserHandlerServer

func RegisterUserHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServer) error

RegisterUserHandlerServer registers the http handlers for service User to "mux". UnaryRPC :call UserServer 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 RegisterUserHandlerFromEndpoint instead.

func RegisterUserServer

func RegisterUserServer(s *grpc.Server, srv UserServer)

Types

type Request

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

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetLogin

func (x *Request) GetLogin() string

func (*Request) GetPassword

func (x *Request) GetPassword() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {
	Status   string            `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Response *Response_Message `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetResponse

func (x *Response) GetResponse() *Response_Message

func (*Response) GetStatus

func (x *Response) GetStatus() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type Response_Message

type Response_Message struct {
	Error   string     `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	Message []*any.Any `protobuf:"bytes,2,rep,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Response_Message) Descriptor deprecated

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

Deprecated: Use Response_Message.ProtoReflect.Descriptor instead.

func (*Response_Message) GetError

func (x *Response_Message) GetError() string

func (*Response_Message) GetMessage

func (x *Response_Message) GetMessage() []*any.Any

func (*Response_Message) ProtoMessage

func (*Response_Message) ProtoMessage()

func (*Response_Message) ProtoReflect

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

func (*Response_Message) Reset

func (x *Response_Message) Reset()

func (*Response_Message) String

func (x *Response_Message) String() string

type UnimplementedUserServer

type UnimplementedUserServer struct {
}

UnimplementedUserServer can be embedded to have forward compatible implementations.

func (*UnimplementedUserServer) Count

func (*UnimplementedUserServer) New

func (*UnimplementedUserServer) UpdatePassword

type UserClient

type UserClient interface {
	New(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	UpdatePassword(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Count(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Response, error)
}

UserClient is the client API for User service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewUserClient

func NewUserClient(cc grpc.ClientConnInterface) UserClient

type UserServer

type UserServer interface {
	New(context.Context, *Request) (*Response, error)
	UpdatePassword(context.Context, *Request) (*Response, error)
	Count(context.Context, *empty.Empty) (*Response, error)
}

UserServer is the server API for User service.

Jump to

Keyboard shortcuts

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