user

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 17 Imported by: 2

Documentation

Overview

Package user is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	UserService_Register_FullMethodName             = "/gen.user.UserService/Register"
	UserService_GetAuthenticatedUser_FullMethodName = "/gen.user.UserService/GetAuthenticatedUser"
)

Variables

View Source
var File_user_rpc_get_auth_user_proto protoreflect.FileDescriptor
View Source
var File_user_rpc_register_user_proto protoreflect.FileDescriptor
View Source
var File_user_service_proto protoreflect.FileDescriptor
View Source
var File_user_user_proto protoreflect.FileDescriptor
View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gen.user.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _UserService_Register_Handler,
		},
		{
			MethodName: "GetAuthenticatedUser",
			Handler:    _UserService_GetAuthenticatedUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "user/service.proto",
}

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

Functions

func RegisterUserServiceHandler added in v1.12.0

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

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

func RegisterUserServiceHandlerClient added in v1.12.0

func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error

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

func RegisterUserServiceHandlerFromEndpoint added in v1.12.0

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

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

func RegisterUserServiceHandlerServer added in v1.12.0

func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error

RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". UnaryRPC :call UserServiceServer 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 RegisterUserServiceHandlerFromEndpoint instead.

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

Types

type GetAuthenticatedUserRequest

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

func (*GetAuthenticatedUserRequest) Descriptor deprecated

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

Deprecated: Use GetAuthenticatedUserRequest.ProtoReflect.Descriptor instead.

func (*GetAuthenticatedUserRequest) GetToken

func (x *GetAuthenticatedUserRequest) GetToken() string

func (*GetAuthenticatedUserRequest) ProtoMessage

func (*GetAuthenticatedUserRequest) ProtoMessage()

func (*GetAuthenticatedUserRequest) ProtoReflect

func (*GetAuthenticatedUserRequest) Reset

func (x *GetAuthenticatedUserRequest) Reset()

func (*GetAuthenticatedUserRequest) String

func (x *GetAuthenticatedUserRequest) String() string

type GetAuthenticatedUserResponse

type GetAuthenticatedUserResponse struct {
	Uid  string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	User *User  `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAuthenticatedUserResponse) Descriptor deprecated

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

Deprecated: Use GetAuthenticatedUserResponse.ProtoReflect.Descriptor instead.

func (*GetAuthenticatedUserResponse) GetUid

func (*GetAuthenticatedUserResponse) GetUser

func (x *GetAuthenticatedUserResponse) GetUser() *User

func (*GetAuthenticatedUserResponse) ProtoMessage

func (*GetAuthenticatedUserResponse) ProtoMessage()

func (*GetAuthenticatedUserResponse) ProtoReflect

func (*GetAuthenticatedUserResponse) Reset

func (x *GetAuthenticatedUserResponse) Reset()

func (*GetAuthenticatedUserResponse) String

type RegisterRequest

type RegisterRequest struct {
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	Uid   string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterRequest) Descriptor deprecated

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

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) GetEmail

func (x *RegisterRequest) GetEmail() string

func (*RegisterRequest) GetUid

func (x *RegisterRequest) GetUid() string

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) ProtoReflect

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

func (*RegisterRequest) Reset

func (x *RegisterRequest) Reset()

func (*RegisterRequest) String

func (x *RegisterRequest) String() string

type RegisterResponse

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

func (*RegisterResponse) Descriptor deprecated

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

Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.

func (*RegisterResponse) GetUid

func (x *RegisterResponse) GetUid() string

func (*RegisterResponse) ProtoMessage

func (*RegisterResponse) ProtoMessage()

func (*RegisterResponse) ProtoReflect

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

func (*RegisterResponse) Reset

func (x *RegisterResponse) Reset()

func (*RegisterResponse) String

func (x *RegisterResponse) String() string

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) Register

type UnsafeUserServiceServer

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

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

type User

type User struct {
	Uid       string                 `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	FirstName string                 `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string                 `protobuf:"bytes,3,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	Email     string                 `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetCreatedAt

func (x *User) GetCreatedAt() *timestamppb.Timestamp

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetFirstName

func (x *User) GetFirstName() string

func (*User) GetLastName

func (x *User) GetLastName() string

func (*User) GetUid

func (x *User) GetUid() string

func (*User) GetUpdatedAt

func (x *User) GetUpdatedAt() *timestamppb.Timestamp

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 UserServiceClient

type UserServiceClient interface {
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	GetAuthenticatedUser(ctx context.Context, in *GetAuthenticatedUserRequest, opts ...grpc.CallOption) (*GetAuthenticatedUserResponse, error)
}

UserServiceClient is the client API for UserService 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 UserServiceServer

type UserServiceServer interface {
	Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
	GetAuthenticatedUser(context.Context, *GetAuthenticatedUserRequest) (*GetAuthenticatedUserResponse, error)
	// contains filtered or unexported methods
}

UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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