user

package
v0.0.0-...-3439342 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Code generated by protoc-gen-cdd. DO NOT EDIT. source: user.proto

Package user is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var AuthConfigFullMethods = map[string]AuthConfig{
	"/user.UserApi/Login":           AuthConfig{NeedAuth: false, Roles: []string{"*"}},
	"/user.UserApi/GetCurrentLogin": AuthConfig{NeedAuth: false, Roles: []string{"*"}},
	"/user.UserApi/UpdatePassword":  AuthConfig{NeedAuth: false, Roles: []string{"*"}},
}
View Source
var FullMethods = fullMethods{
	UserApi_Login:           "/user.UserApi/Login",
	UserApi_GetCurrentLogin: "/user.UserApi/GetCurrentLogin",
	UserApi_UpdatePassword:  "/user.UserApi/UpdatePassword",
}
View Source
var NeedApiKeyFullMethods = []string{}
View Source
var NeedAuthFullMethods = []string{}

Functions

func RegisterUserApiGrstServer

func RegisterUserApiGrstServer(grpcRestServer *grst.Server, hndl UserApiServer)

func RegisterUserApiHandler

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

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

func RegisterUserApiHandlerClient

func RegisterUserApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserApiClient) error

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

func RegisterUserApiHandlerFromEndpoint

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

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

func RegisterUserApiHandlerServer

func RegisterUserApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserApiServer) error

RegisterUserApiHandlerServer registers the http handlers for service UserApi to "mux". UnaryRPC :call UserApiServer 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 RegisterUserApiHandlerFromEndpoint instead.

func RegisterUserApiServer

func RegisterUserApiServer(s *grpc.Server, srv UserApiServer)

func ValidateRequest

func ValidateRequest(req interface{}) error

Types

type AuthConfig

type AuthConfig struct {
	NeedAuth bool
	Roles    []string
}

type LoginReq

type LoginReq struct {
	Email    string `protobuf:"bytes,1,opt,name=Email,json=email,proto3" json:"email,omitempty" validate:"required,email"`
	Password string `protobuf:"bytes,2,opt,name=Password,json=password,proto3" json:"password,omitempty" validate:"required"`
	// contains filtered or unexported fields
}

func (*LoginReq) Descriptor deprecated

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

Deprecated: Use LoginReq.ProtoReflect.Descriptor instead.

func (*LoginReq) GetEmail

func (x *LoginReq) GetEmail() string

func (*LoginReq) GetPassword

func (x *LoginReq) GetPassword() string

func (*LoginReq) ProtoMessage

func (*LoginReq) ProtoMessage()

func (*LoginReq) ProtoReflect

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

func (*LoginReq) Reset

func (x *LoginReq) Reset()

func (*LoginReq) String

func (x *LoginReq) String() string

type UnimplementedUserApiServer

type UnimplementedUserApiServer struct {
}

UnimplementedUserApiServer must be embedded to have forward compatible implementations.

func (UnimplementedUserApiServer) GetCurrentLogin

func (UnimplementedUserApiServer) Login

func (UnimplementedUserApiServer) UpdatePassword

type UnsafeUserApiServer

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

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

type UpdatePasswordReq

type UpdatePasswordReq struct {
	Email       string `protobuf:"bytes,1,opt,name=Email,json=email,proto3" json:"email,omitempty" validate:"required,email"`
	OldPassword string `protobuf:"bytes,2,opt,name=OldPassword,json=old_password,proto3" json:"old_password,omitempty" validate:"required,min=6"`
	NewPassword string `protobuf:"bytes,3,opt,name=NewPassword,json=new_password,proto3" json:"new_password,omitempty" validate:"required,min=6"`
	// contains filtered or unexported fields
}

func (*UpdatePasswordReq) Descriptor deprecated

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

Deprecated: Use UpdatePasswordReq.ProtoReflect.Descriptor instead.

func (*UpdatePasswordReq) GetEmail

func (x *UpdatePasswordReq) GetEmail() string

func (*UpdatePasswordReq) GetNewPassword

func (x *UpdatePasswordReq) GetNewPassword() string

func (*UpdatePasswordReq) GetOldPassword

func (x *UpdatePasswordReq) GetOldPassword() string

func (*UpdatePasswordReq) ProtoMessage

func (*UpdatePasswordReq) ProtoMessage()

func (*UpdatePasswordReq) ProtoReflect

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

func (*UpdatePasswordReq) Reset

func (x *UpdatePasswordReq) Reset()

func (*UpdatePasswordReq) String

func (x *UpdatePasswordReq) String() string

type User

type User struct {
	Name     string `protobuf:"bytes,1,opt,name=Name,json=name,proto3" json:"name,omitempty"`
	Usertype string `protobuf:"bytes,2,opt,name=Usertype,json=usertype,proto3" json:"usertype,omitempty"`
	Email    string `protobuf:"bytes,3,opt,name=Email,json=email,proto3" json:"email,omitempty"`
	Token    string `protobuf:"bytes,4,opt,name=Token,json=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetName

func (x *User) GetName() string

func (*User) GetToken

func (x *User) GetToken() string

func (*User) GetUsertype

func (x *User) GetUsertype() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

type UserApiClient

type UserApiClient interface {
	Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*User, error)
	GetCurrentLogin(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*User, error)
	UpdatePassword(ctx context.Context, in *UpdatePasswordReq, opts ...grpc.CallOption) (*empty.Empty, error)
}

UserApiClient is the client API for UserApi 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 NewUserApiClient

func NewUserApiClient(cc grpc.ClientConnInterface) UserApiClient

func NewUserApiGrstClient

func NewUserApiGrstClient(serverHost string, creds *credentials.TransportCredentials, dialOpts ...grpc.DialOption) (UserApiClient, error)

type UserApiServer

type UserApiServer interface {
	Login(context.Context, *LoginReq) (*User, error)
	GetCurrentLogin(context.Context, *empty.Empty) (*User, error)
	UpdatePassword(context.Context, *UpdatePasswordReq) (*empty.Empty, error)
	// contains filtered or unexported methods
}

UserApiServer is the server API for UserApi service. All implementations must embed UnimplementedUserApiServer for forward compatibility

Jump to

Keyboard shortcuts

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