user_v1

package
v0.0.0-...-531b5da Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package user_v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	UserService_ServiceInfo_FullMethodName  = "/stocklet.user.v1.UserService/ServiceInfo"
	UserService_ViewUser_FullMethodName     = "/stocklet.user.v1.UserService/ViewUser"
	UserService_RegisterUser_FullMethodName = "/stocklet.user.v1.UserService/RegisterUser"
)

Variables

View Source
var File_stocklet_user_v1_service_proto protoreflect.FileDescriptor
View Source
var File_stocklet_user_v1_types_proto protoreflect.FileDescriptor
View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "stocklet.user.v1.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ServiceInfo",
			Handler:    _UserService_ServiceInfo_Handler,
		},
		{
			MethodName: "ViewUser",
			Handler:    _UserService_ViewUser_Handler,
		},
		{
			MethodName: "RegisterUser",
			Handler:    _UserService_RegisterUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "stocklet/user/v1/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

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

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

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

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 RegisterUserRequest

type RegisterUserRequest struct {
	FirstName string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string `protobuf:"bytes,2,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	Email     string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	Password  string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterUserRequest) Descriptor deprecated

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

Deprecated: Use RegisterUserRequest.ProtoReflect.Descriptor instead.

func (*RegisterUserRequest) GetEmail

func (x *RegisterUserRequest) GetEmail() string

func (*RegisterUserRequest) GetFirstName

func (x *RegisterUserRequest) GetFirstName() string

func (*RegisterUserRequest) GetLastName

func (x *RegisterUserRequest) GetLastName() string

func (*RegisterUserRequest) GetPassword

func (x *RegisterUserRequest) GetPassword() string

func (*RegisterUserRequest) ProtoMessage

func (*RegisterUserRequest) ProtoMessage()

func (*RegisterUserRequest) ProtoReflect

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

func (*RegisterUserRequest) Reset

func (x *RegisterUserRequest) Reset()

func (*RegisterUserRequest) String

func (x *RegisterUserRequest) String() string

type RegisterUserResponse

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

func (*RegisterUserResponse) Descriptor deprecated

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

Deprecated: Use RegisterUserResponse.ProtoReflect.Descriptor instead.

func (*RegisterUserResponse) GetUser

func (x *RegisterUserResponse) GetUser() *User

func (*RegisterUserResponse) ProtoMessage

func (*RegisterUserResponse) ProtoMessage()

func (*RegisterUserResponse) ProtoReflect

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

func (*RegisterUserResponse) Reset

func (x *RegisterUserResponse) Reset()

func (*RegisterUserResponse) String

func (x *RegisterUserResponse) String() string

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) RegisterUser

func (UnimplementedUserServiceServer) ServiceInfo

func (UnimplementedUserServiceServer) ViewUser

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 {
	Id        string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Email     string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	CreatedAt int64  `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" 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() int64

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetFirstName

func (x *User) GetFirstName() string

func (*User) GetId

func (x *User) GetId() string

func (*User) GetLastName

func (x *User) GetLastName() string

func (*User) GetUpdatedAt

func (x *User) GetUpdatedAt() int64

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 {
	// View information about the service.
	//
	// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
	ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
	ViewUser(ctx context.Context, in *ViewUserRequest, opts ...grpc.CallOption) (*ViewUserResponse, error)
	RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, 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 {
	// View information about the service.
	//
	// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
	ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
	ViewUser(context.Context, *ViewUserRequest) (*ViewUserResponse, error)
	RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error)
	// contains filtered or unexported methods
}

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

type ViewUserRequest

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

func (*ViewUserRequest) Descriptor deprecated

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

Deprecated: Use ViewUserRequest.ProtoReflect.Descriptor instead.

func (*ViewUserRequest) GetId

func (x *ViewUserRequest) GetId() string

func (*ViewUserRequest) ProtoMessage

func (*ViewUserRequest) ProtoMessage()

func (*ViewUserRequest) ProtoReflect

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

func (*ViewUserRequest) Reset

func (x *ViewUserRequest) Reset()

func (*ViewUserRequest) String

func (x *ViewUserRequest) String() string

type ViewUserResponse

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

func (*ViewUserResponse) Descriptor deprecated

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

Deprecated: Use ViewUserResponse.ProtoReflect.Descriptor instead.

func (*ViewUserResponse) GetUser

func (x *ViewUserResponse) GetUser() *User

func (*ViewUserResponse) ProtoMessage

func (*ViewUserResponse) ProtoMessage()

func (*ViewUserResponse) ProtoReflect

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

func (*ViewUserResponse) Reset

func (x *ViewUserResponse) Reset()

func (*ViewUserResponse) String

func (x *ViewUserResponse) String() string

Jump to

Keyboard shortcuts

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