basev1

package
v0.0.0-...-06d85a1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package basev1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	UserService_Create_FullMethodName = "/base.v1.UserService/Create"
	UserService_List_FullMethodName   = "/base.v1.UserService/List"
)

Variables

View Source
var (
	ErrorCode_name = map[int32]string{
		0:    "ERROR_CODE_UNSPECIFIED",
		1001: "ERROR_CODE_MISSING_BEARER_TOKEN",
		1002: "ERROR_CODE_UNAUTHENTICATED",
		1003: "ERROR_CODE_INVALID_BEARER_TOKEN",
		2000: "ERROR_CODE_VALIDATION",
		2001: "ERROR_CODE_UNIQUE_CONSTRAINT",
		2002: "ERROR_CODE_INVALID_ARGUMENT",
		2003: "ERROR_CODE_MISSING_ARGUMENT",
		2004: "ERROR_CODE_ALREADY_EXIST",
		2005: "ERROR_CODE_INVALID_KEY",
		4000: "ERROR_CODE_NOT_FOUND",
		5000: "ERROR_CODE_INTERNAL",
		5001: "ERROR_CODE_CANCELLED",
		5002: "ERROR_CODE_SQL_BUILDER",
		5003: "ERROR_CODE_CIRCUIT_BREAKER",
		5004: "ERROR_CODE_EXECUTION",
		5005: "ERROR_CODE_SCAN",
		5006: "ERROR_CODE_MIGRATION",
		5007: "ERROR_CODE_TYPE_CONVERSATION",
		5008: "ERROR_CODE_ROLLBACK",
		5009: "ERROR_CODE_NOT_IMPLEMENTED",
		5010: "ERROR_CODE_DATASTORE",
		5011: "ERROR_CODE_SERIALIZATION",
	}
	ErrorCode_value = map[string]int32{
		"ERROR_CODE_UNSPECIFIED":          0,
		"ERROR_CODE_MISSING_BEARER_TOKEN": 1001,
		"ERROR_CODE_UNAUTHENTICATED":      1002,
		"ERROR_CODE_INVALID_BEARER_TOKEN": 1003,
		"ERROR_CODE_VALIDATION":           2000,
		"ERROR_CODE_UNIQUE_CONSTRAINT":    2001,
		"ERROR_CODE_INVALID_ARGUMENT":     2002,
		"ERROR_CODE_MISSING_ARGUMENT":     2003,
		"ERROR_CODE_ALREADY_EXIST":        2004,
		"ERROR_CODE_INVALID_KEY":          2005,
		"ERROR_CODE_NOT_FOUND":            4000,
		"ERROR_CODE_INTERNAL":             5000,
		"ERROR_CODE_CANCELLED":            5001,
		"ERROR_CODE_SQL_BUILDER":          5002,
		"ERROR_CODE_CIRCUIT_BREAKER":      5003,
		"ERROR_CODE_EXECUTION":            5004,
		"ERROR_CODE_SCAN":                 5005,
		"ERROR_CODE_MIGRATION":            5006,
		"ERROR_CODE_TYPE_CONVERSATION":    5007,
		"ERROR_CODE_ROLLBACK":             5008,
		"ERROR_CODE_NOT_IMPLEMENTED":      5009,
		"ERROR_CODE_DATASTORE":            5010,
		"ERROR_CODE_SERIALIZATION":        5011,
	}
)

Enum value maps for ErrorCode.

View Source
var File_base_v1_base_proto protoreflect.FileDescriptor
View Source
var File_base_v1_errors_proto protoreflect.FileDescriptor
View Source
var File_base_v1_openapi_proto protoreflect.FileDescriptor
View Source
var File_base_v1_service_proto protoreflect.FileDescriptor
View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "base.v1.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _UserService_Create_Handler,
		},
		{
			MethodName: "List",
			Handler:    _UserService_List_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "base/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 ErrorCode

type ErrorCode int32
const (
	ErrorCode_ERROR_CODE_UNSPECIFIED ErrorCode = 0
	// authn
	ErrorCode_ERROR_CODE_MISSING_BEARER_TOKEN ErrorCode = 1001
	ErrorCode_ERROR_CODE_UNAUTHENTICATED      ErrorCode = 1002
	ErrorCode_ERROR_CODE_INVALID_BEARER_TOKEN ErrorCode = 1003
	// validation
	ErrorCode_ERROR_CODE_VALIDATION        ErrorCode = 2000
	ErrorCode_ERROR_CODE_UNIQUE_CONSTRAINT ErrorCode = 2001
	ErrorCode_ERROR_CODE_INVALID_ARGUMENT  ErrorCode = 2002
	ErrorCode_ERROR_CODE_MISSING_ARGUMENT  ErrorCode = 2003
	ErrorCode_ERROR_CODE_ALREADY_EXIST     ErrorCode = 2004
	ErrorCode_ERROR_CODE_INVALID_KEY       ErrorCode = 2005
	// not found
	ErrorCode_ERROR_CODE_NOT_FOUND ErrorCode = 4000
	// internal
	ErrorCode_ERROR_CODE_INTERNAL          ErrorCode = 5000
	ErrorCode_ERROR_CODE_CANCELLED         ErrorCode = 5001
	ErrorCode_ERROR_CODE_SQL_BUILDER       ErrorCode = 5002
	ErrorCode_ERROR_CODE_CIRCUIT_BREAKER   ErrorCode = 5003
	ErrorCode_ERROR_CODE_EXECUTION         ErrorCode = 5004
	ErrorCode_ERROR_CODE_SCAN              ErrorCode = 5005
	ErrorCode_ERROR_CODE_MIGRATION         ErrorCode = 5006
	ErrorCode_ERROR_CODE_TYPE_CONVERSATION ErrorCode = 5007
	ErrorCode_ERROR_CODE_ROLLBACK          ErrorCode = 5008
	ErrorCode_ERROR_CODE_NOT_IMPLEMENTED   ErrorCode = 5009
	ErrorCode_ERROR_CODE_DATASTORE         ErrorCode = 5010
	ErrorCode_ERROR_CODE_SERIALIZATION     ErrorCode = 5011
)

func (ErrorCode) Descriptor

func (ErrorCode) Descriptor() protoreflect.EnumDescriptor

func (ErrorCode) Enum

func (x ErrorCode) Enum() *ErrorCode

func (ErrorCode) EnumDescriptor deprecated

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

Deprecated: Use ErrorCode.Descriptor instead.

func (ErrorCode) Number

func (x ErrorCode) Number() protoreflect.EnumNumber

func (ErrorCode) String

func (x ErrorCode) String() string

func (ErrorCode) Type

type ErrorResponse

type ErrorResponse struct {
	Code    ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=base.v1.ErrorCode" json:"code,omitempty"`
	Message string    `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

ErrorResponse

func (*ErrorResponse) Descriptor deprecated

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

Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.

func (*ErrorResponse) GetCode

func (x *ErrorResponse) GetCode() ErrorCode

func (*ErrorResponse) GetMessage

func (x *ErrorResponse) GetMessage() string

func (*ErrorResponse) ProtoMessage

func (*ErrorResponse) ProtoMessage()

func (*ErrorResponse) ProtoReflect

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

func (*ErrorResponse) Reset

func (x *ErrorResponse) Reset()

func (*ErrorResponse) String

func (x *ErrorResponse) String() string

func (*ErrorResponse) Validate

func (m *ErrorResponse) Validate() error

Validate checks the field values on ErrorResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ErrorResponse) ValidateAll

func (m *ErrorResponse) ValidateAll() error

ValidateAll checks the field values on ErrorResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ErrorResponseMultiError, or nil if none found.

type ErrorResponseMultiError

type ErrorResponseMultiError []error

ErrorResponseMultiError is an error wrapping multiple validation errors returned by ErrorResponse.ValidateAll() if the designated constraints aren't met.

func (ErrorResponseMultiError) AllErrors

func (m ErrorResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ErrorResponseMultiError) Error

func (m ErrorResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ErrorResponseValidationError

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

ErrorResponseValidationError is the validation error returned by ErrorResponse.Validate if the designated constraints aren't met.

func (ErrorResponseValidationError) Cause

Cause function returns cause value.

func (ErrorResponseValidationError) Error

Error satisfies the builtin error interface

func (ErrorResponseValidationError) ErrorName

func (e ErrorResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ErrorResponseValidationError) Field

Field function returns field value.

func (ErrorResponseValidationError) Key

Key function returns key value.

func (ErrorResponseValidationError) Reason

Reason function returns reason value.

type MessageResponse

type MessageResponse struct {

	// message is a string message.
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

MessageResponse

func (*MessageResponse) Descriptor deprecated

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

Deprecated: Use MessageResponse.ProtoReflect.Descriptor instead.

func (*MessageResponse) GetMessage

func (x *MessageResponse) GetMessage() string

func (*MessageResponse) ProtoMessage

func (*MessageResponse) ProtoMessage()

func (*MessageResponse) ProtoReflect

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

func (*MessageResponse) Reset

func (x *MessageResponse) Reset()

func (*MessageResponse) String

func (x *MessageResponse) String() string

func (*MessageResponse) Validate

func (m *MessageResponse) Validate() error

Validate checks the field values on MessageResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*MessageResponse) ValidateAll

func (m *MessageResponse) ValidateAll() error

ValidateAll checks the field values on MessageResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in MessageResponseMultiError, or nil if none found.

type MessageResponseMultiError

type MessageResponseMultiError []error

MessageResponseMultiError is an error wrapping multiple validation errors returned by MessageResponse.ValidateAll() if the designated constraints aren't met.

func (MessageResponseMultiError) AllErrors

func (m MessageResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MessageResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type MessageResponseValidationError

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

MessageResponseValidationError is the validation error returned by MessageResponse.Validate if the designated constraints aren't met.

func (MessageResponseValidationError) Cause

Cause function returns cause value.

func (MessageResponseValidationError) Error

Error satisfies the builtin error interface

func (MessageResponseValidationError) ErrorName

func (e MessageResponseValidationError) ErrorName() string

ErrorName returns error name.

func (MessageResponseValidationError) Field

Field function returns field value.

func (MessageResponseValidationError) Key

Key function returns key value.

func (MessageResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) Create

func (UnimplementedUserServiceServer) List

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        uint64                 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`                // The ID of the user.
	Name      string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`             // The name of the user.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,proto3" json:"created_at,omitempty"` // The time at which the user was created.
	// contains filtered or unexported fields
}

User represents a single user in the system.

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

func (x *User) GetId() uint64

func (*User) GetName

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

func (*User) Validate

func (m *User) Validate() error

Validate checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*User) ValidateAll

func (m *User) ValidateAll() error

ValidateAll checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserMultiError, or nil if none found.

type UserCreateRequest

type UserCreateRequest struct {

	// id is a unique identifier for the user.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// name is the name of the user.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

UserCreateRequest is the message used for the request to create a user.

func (*UserCreateRequest) Descriptor deprecated

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

Deprecated: Use UserCreateRequest.ProtoReflect.Descriptor instead.

func (*UserCreateRequest) GetId

func (x *UserCreateRequest) GetId() string

func (*UserCreateRequest) GetName

func (x *UserCreateRequest) GetName() string

func (*UserCreateRequest) ProtoMessage

func (*UserCreateRequest) ProtoMessage()

func (*UserCreateRequest) ProtoReflect

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

func (*UserCreateRequest) Reset

func (x *UserCreateRequest) Reset()

func (*UserCreateRequest) String

func (x *UserCreateRequest) String() string

func (*UserCreateRequest) Validate

func (m *UserCreateRequest) Validate() error

Validate checks the field values on UserCreateRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UserCreateRequest) ValidateAll

func (m *UserCreateRequest) ValidateAll() error

ValidateAll checks the field values on UserCreateRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserCreateRequestMultiError, or nil if none found.

type UserCreateRequestMultiError

type UserCreateRequestMultiError []error

UserCreateRequestMultiError is an error wrapping multiple validation errors returned by UserCreateRequest.ValidateAll() if the designated constraints aren't met.

func (UserCreateRequestMultiError) AllErrors

func (m UserCreateRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserCreateRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type UserCreateRequestValidationError

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

UserCreateRequestValidationError is the validation error returned by UserCreateRequest.Validate if the designated constraints aren't met.

func (UserCreateRequestValidationError) Cause

Cause function returns cause value.

func (UserCreateRequestValidationError) Error

Error satisfies the builtin error interface

func (UserCreateRequestValidationError) ErrorName

ErrorName returns error name.

func (UserCreateRequestValidationError) Field

Field function returns field value.

func (UserCreateRequestValidationError) Key

Key function returns key value.

func (UserCreateRequestValidationError) Reason

Reason function returns reason value.

type UserListRequest

type UserListRequest struct {

	// Pagination size, optional, must be a positive integer.
	Size uint32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
	// Pagination page, optional, must be a non-negative integer.
	Page uint32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"`
	// contains filtered or unexported fields
}

UserListRequest is the message used for the request to list all users.

func (*UserListRequest) Descriptor deprecated

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

Deprecated: Use UserListRequest.ProtoReflect.Descriptor instead.

func (*UserListRequest) GetPage

func (x *UserListRequest) GetPage() uint32

func (*UserListRequest) GetSize

func (x *UserListRequest) GetSize() uint32

func (*UserListRequest) ProtoMessage

func (*UserListRequest) ProtoMessage()

func (*UserListRequest) ProtoReflect

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

func (*UserListRequest) Reset

func (x *UserListRequest) Reset()

func (*UserListRequest) String

func (x *UserListRequest) String() string

func (*UserListRequest) Validate

func (m *UserListRequest) Validate() error

Validate checks the field values on UserListRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UserListRequest) ValidateAll

func (m *UserListRequest) ValidateAll() error

ValidateAll checks the field values on UserListRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserListRequestMultiError, or nil if none found.

type UserListRequestMultiError

type UserListRequestMultiError []error

UserListRequestMultiError is an error wrapping multiple validation errors returned by UserListRequest.ValidateAll() if the designated constraints aren't met.

func (UserListRequestMultiError) AllErrors

func (m UserListRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserListRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type UserListRequestValidationError

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

UserListRequestValidationError is the validation error returned by UserListRequest.Validate if the designated constraints aren't met.

func (UserListRequestValidationError) Cause

Cause function returns cause value.

func (UserListRequestValidationError) Error

Error satisfies the builtin error interface

func (UserListRequestValidationError) ErrorName

func (e UserListRequestValidationError) ErrorName() string

ErrorName returns error name.

func (UserListRequestValidationError) Field

Field function returns field value.

func (UserListRequestValidationError) Key

Key function returns key value.

func (UserListRequestValidationError) Reason

Reason function returns reason value.

type UserListResponse

type UserListResponse struct {

	// users is a list of users.
	Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

UserListResponse is the message returned from the request to list all users.

func (*UserListResponse) Descriptor deprecated

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

Deprecated: Use UserListResponse.ProtoReflect.Descriptor instead.

func (*UserListResponse) GetUsers

func (x *UserListResponse) GetUsers() []*User

func (*UserListResponse) ProtoMessage

func (*UserListResponse) ProtoMessage()

func (*UserListResponse) ProtoReflect

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

func (*UserListResponse) Reset

func (x *UserListResponse) Reset()

func (*UserListResponse) String

func (x *UserListResponse) String() string

func (*UserListResponse) Validate

func (m *UserListResponse) Validate() error

Validate checks the field values on UserListResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UserListResponse) ValidateAll

func (m *UserListResponse) ValidateAll() error

ValidateAll checks the field values on UserListResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserListResponseMultiError, or nil if none found.

type UserListResponseMultiError

type UserListResponseMultiError []error

UserListResponseMultiError is an error wrapping multiple validation errors returned by UserListResponse.ValidateAll() if the designated constraints aren't met.

func (UserListResponseMultiError) AllErrors

func (m UserListResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserListResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type UserListResponseValidationError

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

UserListResponseValidationError is the validation error returned by UserListResponse.Validate if the designated constraints aren't met.

func (UserListResponseValidationError) Cause

Cause function returns cause value.

func (UserListResponseValidationError) Error

Error satisfies the builtin error interface

func (UserListResponseValidationError) ErrorName

ErrorName returns error name.

func (UserListResponseValidationError) Field

Field function returns field value.

func (UserListResponseValidationError) Key

Key function returns key value.

func (UserListResponseValidationError) Reason

Reason function returns reason value.

type UserMultiError

type UserMultiError []error

UserMultiError is an error wrapping multiple validation errors returned by User.ValidateAll() if the designated constraints aren't met.

func (UserMultiError) AllErrors

func (m UserMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserMultiError) Error

func (m UserMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type UserServiceClient

type UserServiceClient interface {
	// Create is a unary RPC to create a new user.
	// It requires a UserCreateRequest and returns a MessageResponse.
	Create(ctx context.Context, in *UserCreateRequest, opts ...grpc.CallOption) (*MessageResponse, error)
	// List is a unary RPC to get a list of all users.
	// It requires a UserListRequest and returns a UserListResponse.
	List(ctx context.Context, in *UserListRequest, opts ...grpc.CallOption) (*UserListResponse, 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 {
	// Create is a unary RPC to create a new user.
	// It requires a UserCreateRequest and returns a MessageResponse.
	Create(context.Context, *UserCreateRequest) (*MessageResponse, error)
	// List is a unary RPC to get a list of all users.
	// It requires a UserListRequest and returns a UserListResponse.
	List(context.Context, *UserListRequest) (*UserListResponse, error)
	// contains filtered or unexported methods
}

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

type UserValidationError

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

UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.

func (UserValidationError) Cause

func (e UserValidationError) Cause() error

Cause function returns cause value.

func (UserValidationError) Error

func (e UserValidationError) Error() string

Error satisfies the builtin error interface

func (UserValidationError) ErrorName

func (e UserValidationError) ErrorName() string

ErrorName returns error name.

func (UserValidationError) Field

func (e UserValidationError) Field() string

Field function returns field value.

func (UserValidationError) Key

func (e UserValidationError) Key() bool

Key function returns key value.

func (UserValidationError) Reason

func (e UserValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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