Documentation
¶
Index ¶
- Variables
- func ErrorAborted(format string, args ...interface{}) *errors.Error
- func ErrorCancelled(format string, args ...interface{}) *errors.Error
- func ErrorConflict(format string, args ...interface{}) *errors.Error
- func ErrorConstraintViolation(format string, args ...interface{}) *errors.Error
- func ErrorDatabaseConnectionFailed(format string, args ...interface{}) *errors.Error
- func ErrorDatabaseError(format string, args ...interface{}) *errors.Error
- func ErrorDuplicateKey(format string, args ...interface{}) *errors.Error
- func ErrorExternalServiceError(format string, args ...interface{}) *errors.Error
- func ErrorExternalServiceUnavailable(format string, args ...interface{}) *errors.Error
- func ErrorForbidden(format string, args ...interface{}) *errors.Error
- func ErrorGatewayTimeout(format string, args ...interface{}) *errors.Error
- func ErrorInternalServerError(format string, args ...interface{}) *errors.Error
- func ErrorInvalidParameter(format string, args ...interface{}) *errors.Error
- func ErrorInvalidState(format string, args ...interface{}) *errors.Error
- func ErrorMethodNotAllowed(format string, args ...interface{}) *errors.Error
- func ErrorMissingParameter(format string, args ...interface{}) *errors.Error
- func ErrorNotFound(format string, args ...interface{}) *errors.Error
- func ErrorOperationNotAllowed(format string, args ...interface{}) *errors.Error
- func ErrorRecordNotFound(format string, args ...interface{}) *errors.Error
- func ErrorRegistryNotFound(format string, args ...interface{}) *errors.Error
- func ErrorRequestTimeout(format string, args ...interface{}) *errors.Error
- func ErrorResourceExists(format string, args ...interface{}) *errors.Error
- func ErrorResourceInUse(format string, args ...interface{}) *errors.Error
- func ErrorServiceUnavailable(format string, args ...interface{}) *errors.Error
- func ErrorTooManyRequests(format string, args ...interface{}) *errors.Error
- func ErrorUnauthenticated(format string, args ...interface{}) *errors.Error
- func ErrorUnknownError(format string, args ...interface{}) *errors.Error
- func ErrorValidationError(format string, args ...interface{}) *errors.Error
- func IsAborted(err error) bool
- func IsCancelled(err error) bool
- func IsConflict(err error) bool
- func IsConstraintViolation(err error) bool
- func IsDatabaseConnectionFailed(err error) bool
- func IsDatabaseError(err error) bool
- func IsDuplicateKey(err error) bool
- func IsExternalServiceError(err error) bool
- func IsExternalServiceUnavailable(err error) bool
- func IsForbidden(err error) bool
- func IsGatewayTimeout(err error) bool
- func IsInternalServerError(err error) bool
- func IsInvalidParameter(err error) bool
- func IsInvalidState(err error) bool
- func IsMethodNotAllowed(err error) bool
- func IsMissingParameter(err error) bool
- func IsNotFound(err error) bool
- func IsOperationNotAllowed(err error) bool
- func IsRecordNotFound(err error) bool
- func IsRegistryNotFound(err error) bool
- func IsRequestTimeout(err error) bool
- func IsResourceExists(err error) bool
- func IsResourceInUse(err error) bool
- func IsServiceUnavailable(err error) bool
- func IsTooManyRequests(err error) bool
- func IsUnauthenticated(err error) bool
- func IsUnknownError(err error) bool
- func IsValidationError(err error) bool
- type ErrorCategory
- func (ErrorCategory) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorCategory) Enum() *ErrorCategory
- func (ErrorCategory) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorCategory) Number() protoreflect.EnumNumber
- func (x ErrorCategory) String() string
- func (ErrorCategory) Type() protoreflect.EnumType
- type ErrorMetadata
- func (*ErrorMetadata) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorMetadata) GetCategory() ErrorCategory
- func (x *ErrorMetadata) GetMetadata() map[string]string
- func (*ErrorMetadata) ProtoMessage()
- func (x *ErrorMetadata) ProtoReflect() protoreflect.Message
- func (x *ErrorMetadata) Reset()
- func (x *ErrorMetadata) String() string
- func (m *ErrorMetadata) Validate() error
- func (m *ErrorMetadata) ValidateAll() error
- type ErrorMetadataMultiError
- type ErrorMetadataValidationError
- func (e ErrorMetadataValidationError) Cause() error
- func (e ErrorMetadataValidationError) Error() string
- func (e ErrorMetadataValidationError) ErrorName() string
- func (e ErrorMetadataValidationError) Field() string
- func (e ErrorMetadataValidationError) Key() bool
- func (e ErrorMetadataValidationError) Reason() string
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
- type Pagination
- func (*Pagination) Descriptor() ([]byte, []int)deprecated
- func (x *Pagination) GetExtra() map[string]*anypb.Any
- func (x *Pagination) GetNextPageToken() string
- func (x *Pagination) GetPage() int32
- func (x *Pagination) GetPageSize() int32
- func (x *Pagination) GetTotalSize() int64
- func (*Pagination) ProtoMessage()
- func (x *Pagination) ProtoReflect() protoreflect.Message
- func (x *Pagination) Reset()
- func (x *Pagination) String() string
- func (m *Pagination) Validate() error
- func (m *Pagination) ValidateAll() error
- type PaginationMultiError
- type PaginationRequest
- func (*PaginationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PaginationRequest) GetFieldMask() *fieldmaskpb.FieldMask
- func (x *PaginationRequest) GetNoPaging() bool
- func (x *PaginationRequest) GetOnlyCount() bool
- func (x *PaginationRequest) GetOrderBy() string
- func (x *PaginationRequest) GetPage() int32
- func (x *PaginationRequest) GetPageSize() int32
- func (x *PaginationRequest) GetPageToken() string
- func (*PaginationRequest) ProtoMessage()
- func (x *PaginationRequest) ProtoReflect() protoreflect.Message
- func (x *PaginationRequest) Reset()
- func (x *PaginationRequest) String() string
- func (m *PaginationRequest) Validate() error
- func (m *PaginationRequest) ValidateAll() error
- type PaginationRequestMultiError
- type PaginationRequestValidationError
- func (e PaginationRequestValidationError) Cause() error
- func (e PaginationRequestValidationError) Error() string
- func (e PaginationRequestValidationError) ErrorName() string
- func (e PaginationRequestValidationError) Field() string
- func (e PaginationRequestValidationError) Key() bool
- func (e PaginationRequestValidationError) Reason() string
- type PaginationValidationError
Constants ¶
This section is empty.
Variables ¶
var ( ErrorCategory_name = map[int32]string{ 0: "GENERAL", 1: "AUTHENTICATION", 2: "DATABASE", 3: "BUSINESS", 4: "EXTERNAL_SERVICE", } ErrorCategory_value = map[string]int32{ "GENERAL": 0, "AUTHENTICATION": 1, "DATABASE": 2, "BUSINESS": 3, "EXTERNAL_SERVICE": 4, } )
Enum value maps for ErrorCategory.
var ( ErrorReason_name = map[int32]string{ 0: "UNKNOWN_ERROR", 1: "VALIDATION_ERROR", 2: "NOT_FOUND", 3: "INTERNAL_SERVER_ERROR", 4: "METHOD_NOT_ALLOWED", 5: "REQUEST_TIMEOUT", 6: "CONFLICT", 7: "TOO_MANY_REQUESTS", 8: "SERVICE_UNAVAILABLE", 9: "GATEWAY_TIMEOUT", 1000: "UNAUTHENTICATED", 1001: "FORBIDDEN", 2000: "DATABASE_ERROR", 2001: "RECORD_NOT_FOUND", 2002: "CONSTRAINT_VIOLATION", 2003: "DUPLICATE_KEY", 2004: "DATABASE_CONNECTION_FAILED", 3000: "INVALID_STATE", 3001: "RESOURCE_EXISTS", 3002: "RESOURCE_IN_USE", 3003: "CANCELLED", 3004: "ABORTED", 3005: "MISSING_PARAMETER", 3006: "INVALID_PARAMETER", 3007: "OPERATION_NOT_ALLOWED", 4000: "EXTERNAL_SERVICE_UNAVAILABLE", 4001: "EXTERNAL_SERVICE_ERROR", 6000: "REGISTRY_NOT_FOUND", } ErrorReason_value = map[string]int32{ "UNKNOWN_ERROR": 0, "VALIDATION_ERROR": 1, "NOT_FOUND": 2, "INTERNAL_SERVER_ERROR": 3, "METHOD_NOT_ALLOWED": 4, "REQUEST_TIMEOUT": 5, "CONFLICT": 6, "TOO_MANY_REQUESTS": 7, "SERVICE_UNAVAILABLE": 8, "GATEWAY_TIMEOUT": 9, "UNAUTHENTICATED": 1000, "FORBIDDEN": 1001, "DATABASE_ERROR": 2000, "RECORD_NOT_FOUND": 2001, "CONSTRAINT_VIOLATION": 2002, "DUPLICATE_KEY": 2003, "DATABASE_CONNECTION_FAILED": 2004, "INVALID_STATE": 3000, "RESOURCE_EXISTS": 3001, "RESOURCE_IN_USE": 3002, "CANCELLED": 3003, "ABORTED": 3004, "MISSING_PARAMETER": 3005, "INVALID_PARAMETER": 3006, "OPERATION_NOT_ALLOWED": 3007, "EXTERNAL_SERVICE_UNAVAILABLE": 4000, "EXTERNAL_SERVICE_ERROR": 4001, "REGISTRY_NOT_FOUND": 6000, } )
Enum value maps for ErrorReason.
var File_runtime_common_v1_errors_proto protoreflect.FileDescriptor
var File_runtime_common_v1_pagination_proto protoreflect.FileDescriptor
Functions ¶
func ErrorAborted ¶
func ErrorCancelled ¶
func ErrorConflict ¶
func ErrorDatabaseError ¶
--- Common Database Errors (2000-2999) ---
func ErrorDuplicateKey ¶
func ErrorExternalServiceUnavailable ¶
--- Common External Service Errors (4000-4999) ---
func ErrorForbidden ¶
func ErrorGatewayTimeout ¶
func ErrorInvalidParameter ¶
func ErrorInvalidState ¶
--- Common Business Logic Errors (3000-3999) ---
func ErrorMethodNotAllowed ¶
func ErrorMissingParameter ¶
func ErrorNotFound ¶
func ErrorRecordNotFound ¶
func ErrorRegistryNotFound ¶
--- Common Registry Errors (6000-6999) ---
func ErrorRequestTimeout ¶
func ErrorResourceExists ¶
func ErrorResourceInUse ¶
func ErrorServiceUnavailable ¶
func ErrorTooManyRequests ¶
func ErrorUnauthenticated ¶
--- Common Authentication & Authorization Errors (1000-1999) ---
func ErrorUnknownError ¶
--- General Framework Errors (0-999) ---
func ErrorValidationError ¶
func IsCancelled ¶
func IsConflict ¶
func IsConstraintViolation ¶
func IsDatabaseError ¶
--- Common Database Errors (2000-2999) ---
func IsDuplicateKey ¶
func IsExternalServiceError ¶
func IsExternalServiceUnavailable ¶
--- Common External Service Errors (4000-4999) ---
func IsForbidden ¶
func IsGatewayTimeout ¶
func IsInternalServerError ¶
func IsInvalidParameter ¶
func IsInvalidState ¶
--- Common Business Logic Errors (3000-3999) ---
func IsMethodNotAllowed ¶
func IsMissingParameter ¶
func IsNotFound ¶
func IsOperationNotAllowed ¶
func IsRecordNotFound ¶
func IsRegistryNotFound ¶
--- Common Registry Errors (6000-6999) ---
func IsRequestTimeout ¶
func IsResourceExists ¶
func IsResourceInUse ¶
func IsServiceUnavailable ¶
func IsTooManyRequests ¶
func IsUnauthenticated ¶
--- Common Authentication & Authorization Errors (1000-1999) ---
func IsValidationError ¶
Types ¶
type ErrorCategory ¶
type ErrorCategory int32
ErrorCategory defines the category of an error. This helps in grouping related errors together for monitoring and client handling.
const ( // General errors not specific to any category. ErrorCategory_GENERAL ErrorCategory = 0 // Authentication and authorization related errors. ErrorCategory_AUTHENTICATION ErrorCategory = 1 // Database related errors. ErrorCategory_DATABASE ErrorCategory = 2 // Business logic related errors. ErrorCategory_BUSINESS ErrorCategory = 3 // External service related errors. ErrorCategory_EXTERNAL_SERVICE ErrorCategory = 4 )
func (ErrorCategory) Descriptor ¶
func (ErrorCategory) Descriptor() protoreflect.EnumDescriptor
func (ErrorCategory) Enum ¶
func (x ErrorCategory) Enum() *ErrorCategory
func (ErrorCategory) EnumDescriptor
deprecated
func (ErrorCategory) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorCategory.Descriptor instead.
func (ErrorCategory) Number ¶
func (x ErrorCategory) Number() protoreflect.EnumNumber
func (ErrorCategory) String ¶
func (x ErrorCategory) String() string
func (ErrorCategory) Type ¶
func (ErrorCategory) Type() protoreflect.EnumType
type ErrorMetadata ¶
type ErrorMetadata struct {
// The category of the error.
Category ErrorCategory `protobuf:"varint,1,opt,name=category,proto3,enum=runtime.common.v1.ErrorCategory" json:"category,omitempty"`
// Additional key-value pairs providing context about the error.
Metadata map[string]string `` /* 143-byte string literal not displayed */
// contains filtered or unexported fields
}
ErrorMetadata contains additional, structured context about an error. It can be used for logging and debugging purposes.
func (*ErrorMetadata) Descriptor
deprecated
func (*ErrorMetadata) Descriptor() ([]byte, []int)
Deprecated: Use ErrorMetadata.ProtoReflect.Descriptor instead.
func (*ErrorMetadata) GetCategory ¶
func (x *ErrorMetadata) GetCategory() ErrorCategory
func (*ErrorMetadata) GetMetadata ¶
func (x *ErrorMetadata) GetMetadata() map[string]string
func (*ErrorMetadata) ProtoMessage ¶
func (*ErrorMetadata) ProtoMessage()
func (*ErrorMetadata) ProtoReflect ¶
func (x *ErrorMetadata) ProtoReflect() protoreflect.Message
func (*ErrorMetadata) Reset ¶
func (x *ErrorMetadata) Reset()
func (*ErrorMetadata) String ¶
func (x *ErrorMetadata) String() string
func (*ErrorMetadata) Validate ¶
func (m *ErrorMetadata) Validate() error
Validate checks the field values on ErrorMetadata 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 (*ErrorMetadata) ValidateAll ¶
func (m *ErrorMetadata) ValidateAll() error
ValidateAll checks the field values on ErrorMetadata 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 ErrorMetadataMultiError, or nil if none found.
type ErrorMetadataMultiError ¶
type ErrorMetadataMultiError []error
ErrorMetadataMultiError is an error wrapping multiple validation errors returned by ErrorMetadata.ValidateAll() if the designated constraints aren't met.
func (ErrorMetadataMultiError) AllErrors ¶
func (m ErrorMetadataMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ErrorMetadataMultiError) Error ¶
func (m ErrorMetadataMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ErrorMetadataValidationError ¶
type ErrorMetadataValidationError struct {
// contains filtered or unexported fields
}
ErrorMetadataValidationError is the validation error returned by ErrorMetadata.Validate if the designated constraints aren't met.
func (ErrorMetadataValidationError) Cause ¶
func (e ErrorMetadataValidationError) Cause() error
Cause function returns cause value.
func (ErrorMetadataValidationError) Error ¶
func (e ErrorMetadataValidationError) Error() string
Error satisfies the builtin error interface
func (ErrorMetadataValidationError) ErrorName ¶
func (e ErrorMetadataValidationError) ErrorName() string
ErrorName returns error name.
func (ErrorMetadataValidationError) Field ¶
func (e ErrorMetadataValidationError) Field() string
Field function returns field value.
func (ErrorMetadataValidationError) Key ¶
func (e ErrorMetadataValidationError) Key() bool
Key function returns key value.
func (ErrorMetadataValidationError) Reason ¶
func (e ErrorMetadataValidationError) Reason() string
Reason function returns reason value.
type ErrorReason ¶
type ErrorReason int32
ErrorReason defines the application's common error codes. These codes are mapped to HTTP status codes and are consistent across all services.
The enum values are structured to allow for future expansion by domain-specific errors. - 0-999: General framework errors - 1000-1999: Common Authentication & Authorization Errors - 2000-2999: Common Database Errors - 3000-3999: Common Business Logic Errors - 4000-4999: Common External Service Errors
Specific reasons for these errors should be defined within the specific domain's error file.
const ( // --- General Framework Errors (0-999) --- ErrorReason_UNKNOWN_ERROR ErrorReason = 0 ErrorReason_VALIDATION_ERROR ErrorReason = 1 ErrorReason_NOT_FOUND ErrorReason = 2 ErrorReason_INTERNAL_SERVER_ERROR ErrorReason = 3 ErrorReason_METHOD_NOT_ALLOWED ErrorReason = 4 ErrorReason_REQUEST_TIMEOUT ErrorReason = 5 ErrorReason_CONFLICT ErrorReason = 6 ErrorReason_TOO_MANY_REQUESTS ErrorReason = 7 ErrorReason_SERVICE_UNAVAILABLE ErrorReason = 8 ErrorReason_GATEWAY_TIMEOUT ErrorReason = 9 // --- Common Authentication & Authorization Errors (1000-1999) --- ErrorReason_UNAUTHENTICATED ErrorReason = 1000 ErrorReason_FORBIDDEN ErrorReason = 1001 // --- Common Database Errors (2000-2999) --- ErrorReason_DATABASE_ERROR ErrorReason = 2000 ErrorReason_RECORD_NOT_FOUND ErrorReason = 2001 ErrorReason_CONSTRAINT_VIOLATION ErrorReason = 2002 ErrorReason_DUPLICATE_KEY ErrorReason = 2003 ErrorReason_DATABASE_CONNECTION_FAILED ErrorReason = 2004 // --- Common Business Logic Errors (3000-3999) --- ErrorReason_INVALID_STATE ErrorReason = 3000 ErrorReason_RESOURCE_EXISTS ErrorReason = 3001 ErrorReason_RESOURCE_IN_USE ErrorReason = 3002 ErrorReason_CANCELLED ErrorReason = 3003 ErrorReason_ABORTED ErrorReason = 3004 ErrorReason_MISSING_PARAMETER ErrorReason = 3005 ErrorReason_INVALID_PARAMETER ErrorReason = 3006 ErrorReason_OPERATION_NOT_ALLOWED ErrorReason = 3007 // --- Common External Service Errors (4000-4999) --- ErrorReason_EXTERNAL_SERVICE_UNAVAILABLE ErrorReason = 4000 ErrorReason_EXTERNAL_SERVICE_ERROR ErrorReason = 4001 // --- Common Registry Errors (6000-6999) --- ErrorReason_REGISTRY_NOT_FOUND ErrorReason = 6000 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
func (ErrorReason) Enum ¶
func (x ErrorReason) Enum() *ErrorReason
func (ErrorReason) EnumDescriptor
deprecated
func (ErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorReason.Descriptor instead.
func (ErrorReason) Number ¶
func (x ErrorReason) Number() protoreflect.EnumNumber
func (ErrorReason) String ¶
func (x ErrorReason) String() string
func (ErrorReason) Type ¶
func (ErrorReason) Type() protoreflect.EnumType
type Pagination ¶
type Pagination struct {
// For offset-based pagination: the current page number (1-indexed).
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
// The number of items retrieved on the current page.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,proto3" json:"page_size,omitempty"`
// For offset-based pagination: the total number of items available across all pages.
// This is optional and may be expensive to calculate for large datasets.
TotalSize int64 `protobuf:"varint,3,opt,name=total_size,proto3" json:"total_size,omitempty"`
// For cursor-based pagination: a token to retrieve the next page of results.
// If empty, there are no more results.
NextPageToken string `protobuf:"bytes,4,opt,name=next_page_token,proto3" json:"next_page_token,omitempty"`
// Additional information about this response.
// content to be added without destroying the current data format
Extra map[string]*anypb.Any `` /* 137-byte string literal not displayed */
// contains filtered or unexported fields
}
Pagination provides a comprehensive structure for pagination responses, supporting both cursor-based (infinite scroll) and offset-based (numbered pages) pagination.
func (*Pagination) Descriptor
deprecated
func (*Pagination) Descriptor() ([]byte, []int)
Deprecated: Use Pagination.ProtoReflect.Descriptor instead.
func (*Pagination) GetNextPageToken ¶
func (x *Pagination) GetNextPageToken() string
func (*Pagination) GetPage ¶
func (x *Pagination) GetPage() int32
func (*Pagination) GetPageSize ¶
func (x *Pagination) GetPageSize() int32
func (*Pagination) GetTotalSize ¶
func (x *Pagination) GetTotalSize() int64
func (*Pagination) ProtoMessage ¶
func (*Pagination) ProtoMessage()
func (*Pagination) ProtoReflect ¶
func (x *Pagination) ProtoReflect() protoreflect.Message
func (*Pagination) Reset ¶
func (x *Pagination) Reset()
func (*Pagination) String ¶
func (x *Pagination) String() string
func (*Pagination) Validate ¶
func (m *Pagination) Validate() error
Validate checks the field values on Pagination 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 (*Pagination) ValidateAll ¶
func (m *Pagination) ValidateAll() error
ValidateAll checks the field values on Pagination 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 PaginationMultiError, or nil if none found.
type PaginationMultiError ¶
type PaginationMultiError []error
PaginationMultiError is an error wrapping multiple validation errors returned by Pagination.ValidateAll() if the designated constraints aren't met.
func (PaginationMultiError) AllErrors ¶
func (m PaginationMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PaginationMultiError) Error ¶
func (m PaginationMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PaginationRequest ¶
type PaginationRequest struct {
// For offset-based pagination: the page number to retrieve (1-indexed).
Page *int32 `protobuf:"varint,1,opt,name=page,proto3,oneof" json:"page,omitempty"`
// The maximum number of items to return per page. The server may enforce a
// maximum limit to this value.
PageSize *int32 `protobuf:"varint,2,opt,name=page_size,proto3,oneof" json:"page_size,omitempty"`
// For cursor-based pagination: a token identifying a page of results the server
// should return. This is the `next_page_token` from a previous response.
PageToken string `protobuf:"bytes,3,opt,name=page_token,proto3" json:"page_token,omitempty"`
// If true, the server will only return the `total_size` in the response Pagination
// message, and the `items` list will be empty. This is useful for fetching
// only the total count of items.
OnlyCount bool `protobuf:"varint,4,opt,name=only_count,proto3" json:"only_count,omitempty"`
// The no_paging is used to disable pagination.
NoPaging *bool `protobuf:"varint,5,opt,name=no_paging,proto3,oneof" json:"no_paging,omitempty"`
// sort condition
OrderBy string `protobuf:"bytes,6,opt,name=order_by,proto3" json:"order_by,omitempty"`
// Field mask
FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,7,opt,name=field_mask,proto3" json:"field_mask,omitempty"`
// contains filtered or unexported fields
}
PaginationRequest provides a flexible structure for pagination requests, supporting both cursor-based (infinite scroll) and offset-based (numbered pages) pagination. The server should prioritize `page_token` if both `page_token` and `page` are provided.
func (*PaginationRequest) Descriptor
deprecated
func (*PaginationRequest) Descriptor() ([]byte, []int)
Deprecated: Use PaginationRequest.ProtoReflect.Descriptor instead.
func (*PaginationRequest) GetFieldMask ¶
func (x *PaginationRequest) GetFieldMask() *fieldmaskpb.FieldMask
func (*PaginationRequest) GetNoPaging ¶
func (x *PaginationRequest) GetNoPaging() bool
func (*PaginationRequest) GetOnlyCount ¶
func (x *PaginationRequest) GetOnlyCount() bool
func (*PaginationRequest) GetOrderBy ¶
func (x *PaginationRequest) GetOrderBy() string
func (*PaginationRequest) GetPage ¶
func (x *PaginationRequest) GetPage() int32
func (*PaginationRequest) GetPageSize ¶
func (x *PaginationRequest) GetPageSize() int32
func (*PaginationRequest) GetPageToken ¶
func (x *PaginationRequest) GetPageToken() string
func (*PaginationRequest) ProtoMessage ¶
func (*PaginationRequest) ProtoMessage()
func (*PaginationRequest) ProtoReflect ¶
func (x *PaginationRequest) ProtoReflect() protoreflect.Message
func (*PaginationRequest) Reset ¶
func (x *PaginationRequest) Reset()
func (*PaginationRequest) String ¶
func (x *PaginationRequest) String() string
func (*PaginationRequest) Validate ¶
func (m *PaginationRequest) Validate() error
Validate checks the field values on PaginationRequest 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 (*PaginationRequest) ValidateAll ¶
func (m *PaginationRequest) ValidateAll() error
ValidateAll checks the field values on PaginationRequest 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 PaginationRequestMultiError, or nil if none found.
type PaginationRequestMultiError ¶
type PaginationRequestMultiError []error
PaginationRequestMultiError is an error wrapping multiple validation errors returned by PaginationRequest.ValidateAll() if the designated constraints aren't met.
func (PaginationRequestMultiError) AllErrors ¶
func (m PaginationRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PaginationRequestMultiError) Error ¶
func (m PaginationRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PaginationRequestValidationError ¶
type PaginationRequestValidationError struct {
// contains filtered or unexported fields
}
PaginationRequestValidationError is the validation error returned by PaginationRequest.Validate if the designated constraints aren't met.
func (PaginationRequestValidationError) Cause ¶
func (e PaginationRequestValidationError) Cause() error
Cause function returns cause value.
func (PaginationRequestValidationError) Error ¶
func (e PaginationRequestValidationError) Error() string
Error satisfies the builtin error interface
func (PaginationRequestValidationError) ErrorName ¶
func (e PaginationRequestValidationError) ErrorName() string
ErrorName returns error name.
func (PaginationRequestValidationError) Field ¶
func (e PaginationRequestValidationError) Field() string
Field function returns field value.
func (PaginationRequestValidationError) Key ¶
func (e PaginationRequestValidationError) Key() bool
Key function returns key value.
func (PaginationRequestValidationError) Reason ¶
func (e PaginationRequestValidationError) Reason() string
Reason function returns reason value.
type PaginationValidationError ¶
type PaginationValidationError struct {
// contains filtered or unexported fields
}
PaginationValidationError is the validation error returned by Pagination.Validate if the designated constraints aren't met.
func (PaginationValidationError) Cause ¶
func (e PaginationValidationError) Cause() error
Cause function returns cause value.
func (PaginationValidationError) Error ¶
func (e PaginationValidationError) Error() string
Error satisfies the builtin error interface
func (PaginationValidationError) ErrorName ¶
func (e PaginationValidationError) ErrorName() string
ErrorName returns error name.
func (PaginationValidationError) Field ¶
func (e PaginationValidationError) Field() string
Field function returns field value.
func (PaginationValidationError) Key ¶
func (e PaginationValidationError) Key() bool
Key function returns key value.
func (PaginationValidationError) Reason ¶
func (e PaginationValidationError) Reason() string
Reason function returns reason value.