apiv1

package
v0.0.0-...-c3afde3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: BSD-3-Clause Imports: 18 Imported by: 5

Documentation

Overview

Package apiv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package apiv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AuthService_Login_FullMethodName = "/api.v1.AuthService/Login"
)
View Source
const (
	UserCommandInternalService_DeleteUser_FullMethodName = "/api.v1.UserCommandInternalService/DeleteUser"
)
View Source
const (
	UserCommandService_RegisterUser_FullMethodName = "/api.v1.UserCommandService/RegisterUser"
)
View Source
const (
	UserQueryService_GetAllUsers_FullMethodName = "/api.v1.UserQueryService/GetAllUsers"
)

Variables

View Source
var (
	AuthErrorCode_name = map[int32]string{
		0: "AUTH_ERROR_CODE_UNSPECIFIED",
		1: "AUTH_ERROR_CODE_INTERNAL",
		2: "AUTH_ERROR_CODE_EMPTY_FIELD",
		3: "AUTH_ERROR_CODE_UNAUTHORIZED",
		4: "AUTH_ERROR_CODE_INVALID_ARGUMENT",
	}
	AuthErrorCode_value = map[string]int32{
		"AUTH_ERROR_CODE_UNSPECIFIED":      0,
		"AUTH_ERROR_CODE_INTERNAL":         1,
		"AUTH_ERROR_CODE_EMPTY_FIELD":      2,
		"AUTH_ERROR_CODE_UNAUTHORIZED":     3,
		"AUTH_ERROR_CODE_INVALID_ARGUMENT": 4,
	}
)

Enum value maps for AuthErrorCode.

View Source
var (
	UserOutboxStatus_name = map[int32]string{
		0: "USER_OUTBOX_STATUS_UNSPECIFIED",
		1: "USER_OUTBOX_STATUS_READY",
		2: "USER_OUTBOX_STATUS_PROCESSED",
		3: "USER_OUTBOX_STATUS_DELIVERED",
		4: "USER_OUTBOX_STATUS_FAILED",
	}
	UserOutboxStatus_value = map[string]int32{
		"USER_OUTBOX_STATUS_UNSPECIFIED": 0,
		"USER_OUTBOX_STATUS_READY":       1,
		"USER_OUTBOX_STATUS_PROCESSED":   2,
		"USER_OUTBOX_STATUS_DELIVERED":   3,
		"USER_OUTBOX_STATUS_FAILED":      4,
	}
)

Enum value maps for UserOutboxStatus.

View Source
var (
	UserErrorCode_name = map[int32]string{
		0: "USER_ERROR_CODE_UNSPECIFIED",
		1: "USER_ERROR_CODE_INTERNAL",
		2: "USER_ERROR_CODE_EMPTY_USER",
		3: "USER_ERROR_CODE_ALREADY_EXISTS",
		4: "USER_ERROR_CODE_INVALID_NAME",
		5: "USER_ERROR_CODE_INVALID_EMAIL",
		6: "USER_ERROR_CODE_NOT_FOUND",
	}
	UserErrorCode_value = map[string]int32{
		"USER_ERROR_CODE_UNSPECIFIED":    0,
		"USER_ERROR_CODE_INTERNAL":       1,
		"USER_ERROR_CODE_EMPTY_USER":     2,
		"USER_ERROR_CODE_ALREADY_EXISTS": 3,
		"USER_ERROR_CODE_INVALID_NAME":   4,
		"USER_ERROR_CODE_INVALID_EMAIL":  5,
		"USER_ERROR_CODE_NOT_FOUND":      6,
	}
)

Enum value maps for UserErrorCode.

View Source
var AuthService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.v1.AuthService",
	HandlerType: (*AuthServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Login",
			Handler:    _AuthService_Login_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/auth.proto",
}

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

View Source
var File_api_v1_auth_proto protoreflect.FileDescriptor
View Source
var File_api_v1_user_proto protoreflect.FileDescriptor
View Source
var UserCommandInternalService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.v1.UserCommandInternalService",
	HandlerType: (*UserCommandInternalServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DeleteUser",
			Handler:    _UserCommandInternalService_DeleteUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/user.proto",
}

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

View Source
var UserCommandService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.v1.UserCommandService",
	HandlerType: (*UserCommandServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterUser",
			Handler:    _UserCommandService_RegisterUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/user.proto",
}

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

View Source
var UserQueryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.v1.UserQueryService",
	HandlerType: (*UserQueryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetAllUsers",
			Handler:    _UserQueryService_GetAllUsers_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/user.proto",
}

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

Functions

func RegisterAuthServiceHandler

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

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

func RegisterAuthServiceHandlerClient

func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error

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

func RegisterAuthServiceHandlerFromEndpoint

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

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

func RegisterAuthServiceHandlerServer

func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error

RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". UnaryRPC :call AuthServiceServer 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 RegisterAuthServiceHandlerFromEndpoint instead.

func RegisterAuthServiceServer

func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)

func RegisterUserCommandInternalServiceHandler

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

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

func RegisterUserCommandInternalServiceHandlerClient

func RegisterUserCommandInternalServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserCommandInternalServiceClient) error

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

func RegisterUserCommandInternalServiceHandlerFromEndpoint

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

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

func RegisterUserCommandInternalServiceHandlerServer

func RegisterUserCommandInternalServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserCommandInternalServiceServer) error

RegisterUserCommandInternalServiceHandlerServer registers the http handlers for service UserCommandInternalService to "mux". UnaryRPC :call UserCommandInternalServiceServer 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 RegisterUserCommandInternalServiceHandlerFromEndpoint instead.

func RegisterUserCommandInternalServiceServer

func RegisterUserCommandInternalServiceServer(s grpc.ServiceRegistrar, srv UserCommandInternalServiceServer)

func RegisterUserCommandServiceHandler

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

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

func RegisterUserCommandServiceHandlerClient

func RegisterUserCommandServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserCommandServiceClient) error

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

func RegisterUserCommandServiceHandlerFromEndpoint

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

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

func RegisterUserCommandServiceHandlerServer

func RegisterUserCommandServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserCommandServiceServer) error

RegisterUserCommandServiceHandlerServer registers the http handlers for service UserCommandService to "mux". UnaryRPC :call UserCommandServiceServer 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 RegisterUserCommandServiceHandlerFromEndpoint instead.

func RegisterUserCommandServiceServer

func RegisterUserCommandServiceServer(s grpc.ServiceRegistrar, srv UserCommandServiceServer)

func RegisterUserQueryServiceHandler

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

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

func RegisterUserQueryServiceHandlerClient

func RegisterUserQueryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserQueryServiceClient) error

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

func RegisterUserQueryServiceHandlerFromEndpoint

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

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

func RegisterUserQueryServiceHandlerServer

func RegisterUserQueryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserQueryServiceServer) error

RegisterUserQueryServiceHandlerServer registers the http handlers for service UserQueryService to "mux". UnaryRPC :call UserQueryServiceServer 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 RegisterUserQueryServiceHandlerFromEndpoint instead.

func RegisterUserQueryServiceServer

func RegisterUserQueryServiceServer(s grpc.ServiceRegistrar, srv UserQueryServiceServer)

Types

type AuthError

type AuthError struct {

	// error_code represents specific and unique error code for auth.
	ErrorCode AuthErrorCode `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=api.v1.AuthErrorCode" json:"error_code,omitempty"`
	// contains filtered or unexported fields
}

AuthError represents message for any error happening in auth service.

func (*AuthError) Descriptor deprecated

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

Deprecated: Use AuthError.ProtoReflect.Descriptor instead.

func (*AuthError) GetErrorCode

func (x *AuthError) GetErrorCode() AuthErrorCode

func (*AuthError) ProtoMessage

func (*AuthError) ProtoMessage()

func (*AuthError) ProtoReflect

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

func (*AuthError) Reset

func (x *AuthError) Reset()

func (*AuthError) String

func (x *AuthError) String() string

type AuthErrorCode

type AuthErrorCode int32

AuthErrorCode enumerates auth error code.

const (
	// Default enum code according to
	// https://medium.com/@akhaku/protobuf-definition-best-practices-87f281576f31.
	AuthErrorCode_AUTH_ERROR_CODE_UNSPECIFIED AuthErrorCode = 0
	// Unexpected behavior occured in system.
	AuthErrorCode_AUTH_ERROR_CODE_INTERNAL AuthErrorCode = 1
	// Mandatory field is empty.
	AuthErrorCode_AUTH_ERROR_CODE_EMPTY_FIELD AuthErrorCode = 2
	// Unauthorized.
	AuthErrorCode_AUTH_ERROR_CODE_UNAUTHORIZED AuthErrorCode = 3
	// Some arguments must be invalid.
	AuthErrorCode_AUTH_ERROR_CODE_INVALID_ARGUMENT AuthErrorCode = 4
)

func (AuthErrorCode) Descriptor

func (AuthErrorCode) Enum

func (x AuthErrorCode) Enum() *AuthErrorCode

func (AuthErrorCode) EnumDescriptor deprecated

func (AuthErrorCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use AuthErrorCode.Descriptor instead.

func (AuthErrorCode) Number

func (AuthErrorCode) String

func (x AuthErrorCode) String() string

func (AuthErrorCode) Type

type AuthServiceClient

type AuthServiceClient interface {
	// Login.
	//
	// This endpoint logs in a user.
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
}

AuthServiceClient is the client API for AuthService 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 AuthServiceServer

type AuthServiceServer interface {
	// Login.
	//
	// This endpoint logs in a user.
	Login(context.Context, *LoginRequest) (*LoginResponse, error)
	// contains filtered or unexported methods
}

AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility

type Credential

type Credential struct {

	// email represents user's email.
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	// password represents user's password.
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// client_id represents client ID.
	ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// contains filtered or unexported fields
}

Credential represents login credential.

func (*Credential) Descriptor deprecated

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

Deprecated: Use Credential.ProtoReflect.Descriptor instead.

func (*Credential) GetClientId

func (x *Credential) GetClientId() string

func (*Credential) GetEmail

func (x *Credential) GetEmail() string

func (*Credential) GetPassword

func (x *Credential) GetPassword() string

func (*Credential) ProtoMessage

func (*Credential) ProtoMessage()

func (*Credential) ProtoReflect

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

func (*Credential) Reset

func (x *Credential) Reset()

func (*Credential) String

func (x *Credential) String() string

type DeleteUserRequest

type DeleteUserRequest struct {

	// id represents user's id.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

DeleteUserRequest represents request for delete user.

func (*DeleteUserRequest) Descriptor deprecated

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

Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.

func (*DeleteUserRequest) GetId

func (x *DeleteUserRequest) GetId() string

func (*DeleteUserRequest) ProtoMessage

func (*DeleteUserRequest) ProtoMessage()

func (*DeleteUserRequest) ProtoReflect

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

func (*DeleteUserRequest) Reset

func (x *DeleteUserRequest) Reset()

func (*DeleteUserRequest) String

func (x *DeleteUserRequest) String() string

type DeleteUserResponse

type DeleteUserResponse struct {
	// contains filtered or unexported fields
}

DeleteUserResponse represents response from delete user.

func (*DeleteUserResponse) Descriptor deprecated

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

Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead.

func (*DeleteUserResponse) ProtoMessage

func (*DeleteUserResponse) ProtoMessage()

func (*DeleteUserResponse) ProtoReflect

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

func (*DeleteUserResponse) Reset

func (x *DeleteUserResponse) Reset()

func (*DeleteUserResponse) String

func (x *DeleteUserResponse) String() string

type GetAllUsersRequest

type GetAllUsersRequest struct {

	// limit specifies how many users to retrieve in a single call.
	Limit uint32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

GetAllUsersRequest represents request for get all users.

func (*GetAllUsersRequest) Descriptor deprecated

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

Deprecated: Use GetAllUsersRequest.ProtoReflect.Descriptor instead.

func (*GetAllUsersRequest) GetLimit

func (x *GetAllUsersRequest) GetLimit() uint32

func (*GetAllUsersRequest) ProtoMessage

func (*GetAllUsersRequest) ProtoMessage()

func (*GetAllUsersRequest) ProtoReflect

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

func (*GetAllUsersRequest) Reset

func (x *GetAllUsersRequest) Reset()

func (*GetAllUsersRequest) String

func (x *GetAllUsersRequest) String() string

type GetAllUsersResponse

type GetAllUsersResponse struct {

	// data represents an array of user data.
	Data []*User `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

GetAllUsersResponse represents response from get all users.

func (*GetAllUsersResponse) Descriptor deprecated

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

Deprecated: Use GetAllUsersResponse.ProtoReflect.Descriptor instead.

func (*GetAllUsersResponse) GetData

func (x *GetAllUsersResponse) GetData() []*User

func (*GetAllUsersResponse) ProtoMessage

func (*GetAllUsersResponse) ProtoMessage()

func (*GetAllUsersResponse) ProtoReflect

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

func (*GetAllUsersResponse) Reset

func (x *GetAllUsersResponse) Reset()

func (*GetAllUsersResponse) String

func (x *GetAllUsersResponse) String() string

type LoginRequest

type LoginRequest struct {

	// credential represents credential for login.
	Credential *Credential `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"`
	// contains filtered or unexported fields
}

LoginRequest represents request for login.

func (*LoginRequest) Descriptor deprecated

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

Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.

func (*LoginRequest) GetCredential

func (x *LoginRequest) GetCredential() *Credential

func (*LoginRequest) ProtoMessage

func (*LoginRequest) ProtoMessage()

func (*LoginRequest) ProtoReflect

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

func (*LoginRequest) Reset

func (x *LoginRequest) Reset()

func (*LoginRequest) String

func (x *LoginRequest) String() string

type LoginResponse

type LoginResponse struct {

	// data represents token.
	Data *Token `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

LoginResponse represents response from login.

func (*LoginResponse) Descriptor deprecated

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

Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.

func (*LoginResponse) GetData

func (x *LoginResponse) GetData() *Token

func (*LoginResponse) ProtoMessage

func (*LoginResponse) ProtoMessage()

func (*LoginResponse) ProtoReflect

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

func (*LoginResponse) Reset

func (x *LoginResponse) Reset()

func (*LoginResponse) String

func (x *LoginResponse) String() string

type RegisterUserRequest

type RegisterUserRequest struct {

	// user represents user data.
	User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

RegisterUserRequest represents request for register user.

func (*RegisterUserRequest) Descriptor deprecated

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

Deprecated: Use RegisterUserRequest.ProtoReflect.Descriptor instead.

func (*RegisterUserRequest) GetUser

func (x *RegisterUserRequest) GetUser() *User

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 {

	// data represents user.
	Data *User `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

RegisterUserResponse represents response from register user.

func (*RegisterUserResponse) Descriptor deprecated

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

Deprecated: Use RegisterUserResponse.ProtoReflect.Descriptor instead.

func (*RegisterUserResponse) GetData

func (x *RegisterUserResponse) GetData() *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 Token

type Token struct {

	// access_token represents an access token.
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	// access_token_expires_in represents how many seconds left before access token expired.
	AccessTokenExpiresIn uint32 `` /* 126-byte string literal not displayed */
	// refresh_token represents an refresh token.
	RefreshToken string `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// refresh_token_expires_in represents how many seconds left before refresh token expired.
	RefreshTokenExpiresIn uint32 `` /* 129-byte string literal not displayed */
	// token_type represents the type of token.
	TokenType string `protobuf:"bytes,5,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"`
	// contains filtered or unexported fields
}

Token represents token.

func (*Token) Descriptor deprecated

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

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetAccessToken

func (x *Token) GetAccessToken() string

func (*Token) GetAccessTokenExpiresIn

func (x *Token) GetAccessTokenExpiresIn() uint32

func (*Token) GetRefreshToken

func (x *Token) GetRefreshToken() string

func (*Token) GetRefreshTokenExpiresIn

func (x *Token) GetRefreshTokenExpiresIn() uint32

func (*Token) GetTokenType

func (x *Token) GetTokenType() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

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

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type UnimplementedAuthServiceServer

type UnimplementedAuthServiceServer struct {
}

UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServiceServer) Login

type UnimplementedUserCommandInternalServiceServer

type UnimplementedUserCommandInternalServiceServer struct {
}

UnimplementedUserCommandInternalServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserCommandInternalServiceServer) DeleteUser

type UnimplementedUserCommandServiceServer

type UnimplementedUserCommandServiceServer struct {
}

UnimplementedUserCommandServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserCommandServiceServer) RegisterUser

type UnimplementedUserQueryServiceServer

type UnimplementedUserQueryServiceServer struct {
}

UnimplementedUserQueryServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserQueryServiceServer) GetAllUsers

type UnsafeAuthServiceServer

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

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

type UnsafeUserCommandInternalServiceServer

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

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

type UnsafeUserCommandServiceServer

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

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

type UnsafeUserQueryServiceServer

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

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

type User

type User struct {

	// id represents a user's id.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// email represents a user's email.
	Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	// password represents the user's password.
	Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	// name represents a user's name.
	Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	// created_at represents when the user was registered.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// updated_at represents when the user was last updated.
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

User represents a user data.

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) GetId

func (x *User) GetId() string

func (*User) GetName

func (x *User) GetName() string

func (*User) GetPassword

func (x *User) GetPassword() 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 UserCommandInternalServiceClient

type UserCommandInternalServiceClient interface {
	// Delete a user.
	//
	// This endpoint deletes a new user.
	// It is expected to be hidden or internal use only.
	DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error)
}

UserCommandInternalServiceClient is the client API for UserCommandInternalService 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 UserCommandInternalServiceServer

type UserCommandInternalServiceServer interface {
	// Delete a user.
	//
	// This endpoint deletes a new user.
	// It is expected to be hidden or internal use only.
	DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
	// contains filtered or unexported methods
}

UserCommandInternalServiceServer is the server API for UserCommandInternalService service. All implementations must embed UnimplementedUserCommandInternalServiceServer for forward compatibility

type UserCommandServiceClient

type UserCommandServiceClient interface {
	// Register a new user.
	//
	// This endpoint registers a new user.
	RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error)
}

UserCommandServiceClient is the client API for UserCommandService 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 UserCommandServiceServer

type UserCommandServiceServer interface {
	// Register a new user.
	//
	// This endpoint registers a new user.
	RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error)
	// contains filtered or unexported methods
}

UserCommandServiceServer is the server API for UserCommandService service. All implementations must embed UnimplementedUserCommandServiceServer for forward compatibility

type UserError

type UserError struct {

	// error_code represents specific and unique error code for user.
	ErrorCode UserErrorCode `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=api.v1.UserErrorCode" json:"error_code,omitempty"`
	// contains filtered or unexported fields
}

UserError represents message for any error happening in user.

func (*UserError) Descriptor deprecated

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

Deprecated: Use UserError.ProtoReflect.Descriptor instead.

func (*UserError) GetErrorCode

func (x *UserError) GetErrorCode() UserErrorCode

func (*UserError) ProtoMessage

func (*UserError) ProtoMessage()

func (*UserError) ProtoReflect

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

func (*UserError) Reset

func (x *UserError) Reset()

func (*UserError) String

func (x *UserError) String() string

type UserErrorCode

type UserErrorCode int32

UserErrorCode enumerates user error code.

const (
	// Default enum code according to
	// https://medium.com/@akhaku/protobuf-definition-best-practices-87f281576f31.
	UserErrorCode_USER_ERROR_CODE_UNSPECIFIED UserErrorCode = 0
	// Unexpected behavior occured in system.
	UserErrorCode_USER_ERROR_CODE_INTERNAL UserErrorCode = 1
	// User instance is empty or nil.
	UserErrorCode_USER_ERROR_CODE_EMPTY_USER UserErrorCode = 2
	// User already exists.
	// The uniqueness of a user is represented by email.
	UserErrorCode_USER_ERROR_CODE_ALREADY_EXISTS UserErrorCode = 3
	// User's name is invalid.
	// Allowed characters are alphabet only.
	UserErrorCode_USER_ERROR_CODE_INVALID_NAME UserErrorCode = 4
	// User's email is invalid.
	UserErrorCode_USER_ERROR_CODE_INVALID_EMAIL UserErrorCode = 5
	// User not found.
	UserErrorCode_USER_ERROR_CODE_NOT_FOUND UserErrorCode = 6
)

func (UserErrorCode) Descriptor

func (UserErrorCode) Enum

func (x UserErrorCode) Enum() *UserErrorCode

func (UserErrorCode) EnumDescriptor deprecated

func (UserErrorCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use UserErrorCode.Descriptor instead.

func (UserErrorCode) Number

func (UserErrorCode) String

func (x UserErrorCode) String() string

func (UserErrorCode) Type

type UserOutbox

type UserOutbox struct {

	// id represents a users_outbox's id.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// status represents specific status.
	Status UserOutboxStatus `protobuf:"varint,2,opt,name=status,proto3,enum=api.v1.UserOutboxStatus" json:"status,omitempty"`
	// payload represents a user message.
	Payload *User `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	// created_at represents when the user was registered.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// updated_at represents when the user was last updated.
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*UserOutbox) Descriptor deprecated

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

Deprecated: Use UserOutbox.ProtoReflect.Descriptor instead.

func (*UserOutbox) GetCreatedAt

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

func (*UserOutbox) GetId

func (x *UserOutbox) GetId() string

func (*UserOutbox) GetPayload

func (x *UserOutbox) GetPayload() *User

func (*UserOutbox) GetStatus

func (x *UserOutbox) GetStatus() UserOutboxStatus

func (*UserOutbox) GetUpdatedAt

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

func (*UserOutbox) ProtoMessage

func (*UserOutbox) ProtoMessage()

func (*UserOutbox) ProtoReflect

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

func (*UserOutbox) Reset

func (x *UserOutbox) Reset()

func (*UserOutbox) String

func (x *UserOutbox) String() string

type UserOutboxStatus

type UserOutboxStatus int32

UserOutboxStatus enumerates user outbox status code.

const (
	// Default enum code according to
	// https://medium.com/@akhaku/protobuf-definition-best-practices-87f281576f31.
	UserOutboxStatus_USER_OUTBOX_STATUS_UNSPECIFIED UserOutboxStatus = 0
	// Record ready to be picked up.
	UserOutboxStatus_USER_OUTBOX_STATUS_READY UserOutboxStatus = 1
	// Record is being processed to be sent to server.
	UserOutboxStatus_USER_OUTBOX_STATUS_PROCESSED UserOutboxStatus = 2
	// Record is successfully delivered to server.
	UserOutboxStatus_USER_OUTBOX_STATUS_DELIVERED UserOutboxStatus = 3
	// Record is failed to be processed.
	UserOutboxStatus_USER_OUTBOX_STATUS_FAILED UserOutboxStatus = 4
)

func (UserOutboxStatus) Descriptor

func (UserOutboxStatus) Enum

func (UserOutboxStatus) EnumDescriptor deprecated

func (UserOutboxStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use UserOutboxStatus.Descriptor instead.

func (UserOutboxStatus) Number

func (UserOutboxStatus) String

func (x UserOutboxStatus) String() string

func (UserOutboxStatus) Type

type UserQueryServiceClient

type UserQueryServiceClient interface {
	// Get all users.
	//
	// This endpoint gets all available users in the system.
	// Currently, it only retrieves 10 users at most.
	GetAllUsers(ctx context.Context, in *GetAllUsersRequest, opts ...grpc.CallOption) (*GetAllUsersResponse, error)
}

UserQueryServiceClient is the client API for UserQueryService 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 UserQueryServiceServer

type UserQueryServiceServer interface {
	// Get all users.
	//
	// This endpoint gets all available users in the system.
	// Currently, it only retrieves 10 users at most.
	GetAllUsers(context.Context, *GetAllUsersRequest) (*GetAllUsersResponse, error)
	// contains filtered or unexported methods
}

UserQueryServiceServer is the server API for UserQueryService service. All implementations must embed UnimplementedUserQueryServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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