commonv1

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorCategory_name = map[int32]string{
		0: "ERROR_CATEGORY_GENERAL_UNSPECIFIED",
		1: "ERROR_CATEGORY_AUTHENTICATION",
		2: "ERROR_CATEGORY_DATABASE",
		3: "ERROR_CATEGORY_BUSINESS",
		4: "ERROR_CATEGORY_EXTERNAL_SERVICE",
	}
	ErrorCategory_value = map[string]int32{
		"ERROR_CATEGORY_GENERAL_UNSPECIFIED": 0,
		"ERROR_CATEGORY_AUTHENTICATION":      1,
		"ERROR_CATEGORY_DATABASE":            2,
		"ERROR_CATEGORY_BUSINESS":            3,
		"ERROR_CATEGORY_EXTERNAL_SERVICE":    4,
	}
)

Enum value maps for ErrorCategory.

View Source
var (
	ErrorReason_name = map[int32]string{
		0:    "ERROR_REASON_UNKNOWN_UNSPECIFIED",
		1:    "ERROR_REASON_VALIDATION_ERROR",
		2:    "ERROR_REASON_NOT_FOUND",
		3:    "ERROR_REASON_INTERNAL_SERVER_ERROR",
		4:    "ERROR_REASON_METHOD_NOT_ALLOWED",
		5:    "ERROR_REASON_REQUEST_TIMEOUT",
		6:    "ERROR_REASON_CONFLICT",
		7:    "ERROR_REASON_TOO_MANY_REQUESTS",
		8:    "ERROR_REASON_SERVICE_UNAVAILABLE",
		9:    "ERROR_REASON_GATEWAY_TIMEOUT",
		1000: "ERROR_REASON_UNAUTHENTICATED",
		1001: "ERROR_REASON_FORBIDDEN",
		2000: "ERROR_REASON_DATABASE_ERROR",
		2001: "ERROR_REASON_RECORD_NOT_FOUND",
		2002: "ERROR_REASON_CONSTRAINT_VIOLATION",
		2003: "ERROR_REASON_DUPLICATE_KEY",
		2004: "ERROR_REASON_DATABASE_CONNECTION_FAILED",
		3000: "ERROR_REASON_INVALID_STATE",
		3001: "ERROR_REASON_RESOURCE_EXISTS",
		3002: "ERROR_REASON_RESOURCE_IN_USE",
		3003: "ERROR_REASON_CANCELLED",
		3004: "ERROR_REASON_ABORTED",
		3005: "ERROR_REASON_MISSING_PARAMETER",
		3006: "ERROR_REASON_INVALID_PARAMETER",
		3007: "ERROR_REASON_OPERATION_NOT_ALLOWED",
		4000: "ERROR_REASON_EXTERNAL_SERVICE_UNAVAILABLE",
		4001: "ERROR_REASON_EXTERNAL_SERVICE_ERROR",
		6000: "ERROR_REASON_REGISTRY_NOT_FOUND",
	}
	ErrorReason_value = map[string]int32{
		"ERROR_REASON_UNKNOWN_UNSPECIFIED":          0,
		"ERROR_REASON_VALIDATION_ERROR":             1,
		"ERROR_REASON_NOT_FOUND":                    2,
		"ERROR_REASON_INTERNAL_SERVER_ERROR":        3,
		"ERROR_REASON_METHOD_NOT_ALLOWED":           4,
		"ERROR_REASON_REQUEST_TIMEOUT":              5,
		"ERROR_REASON_CONFLICT":                     6,
		"ERROR_REASON_TOO_MANY_REQUESTS":            7,
		"ERROR_REASON_SERVICE_UNAVAILABLE":          8,
		"ERROR_REASON_GATEWAY_TIMEOUT":              9,
		"ERROR_REASON_UNAUTHENTICATED":              1000,
		"ERROR_REASON_FORBIDDEN":                    1001,
		"ERROR_REASON_DATABASE_ERROR":               2000,
		"ERROR_REASON_RECORD_NOT_FOUND":             2001,
		"ERROR_REASON_CONSTRAINT_VIOLATION":         2002,
		"ERROR_REASON_DUPLICATE_KEY":                2003,
		"ERROR_REASON_DATABASE_CONNECTION_FAILED":   2004,
		"ERROR_REASON_INVALID_STATE":                3000,
		"ERROR_REASON_RESOURCE_EXISTS":              3001,
		"ERROR_REASON_RESOURCE_IN_USE":              3002,
		"ERROR_REASON_CANCELLED":                    3003,
		"ERROR_REASON_ABORTED":                      3004,
		"ERROR_REASON_MISSING_PARAMETER":            3005,
		"ERROR_REASON_INVALID_PARAMETER":            3006,
		"ERROR_REASON_OPERATION_NOT_ALLOWED":        3007,
		"ERROR_REASON_EXTERNAL_SERVICE_UNAVAILABLE": 4000,
		"ERROR_REASON_EXTERNAL_SERVICE_ERROR":       4001,
		"ERROR_REASON_REGISTRY_NOT_FOUND":           6000,
	}
)

Enum value maps for ErrorReason.

View Source
var File_config_common_v1_errors_proto protoreflect.FileDescriptor
View Source
var File_config_common_v1_pagination_proto protoreflect.FileDescriptor

Functions

func ErrorErrorReasonAborted added in v0.2.13

func ErrorErrorReasonAborted(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonCancelled added in v0.2.13

func ErrorErrorReasonCancelled(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonConflict added in v0.2.13

func ErrorErrorReasonConflict(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonConstraintViolation added in v0.2.13

func ErrorErrorReasonConstraintViolation(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonDatabaseConnectionFailed added in v0.2.13

func ErrorErrorReasonDatabaseConnectionFailed(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonDatabaseError added in v0.2.13

func ErrorErrorReasonDatabaseError(format string, args ...interface{}) *errors.Error

--- Common Database Errors (2000-2999) ---

func ErrorErrorReasonDuplicateKey added in v0.2.13

func ErrorErrorReasonDuplicateKey(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonExternalServiceError added in v0.2.13

func ErrorErrorReasonExternalServiceError(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonExternalServiceUnavailable added in v0.2.13

func ErrorErrorReasonExternalServiceUnavailable(format string, args ...interface{}) *errors.Error

--- Common External Service Errors (4000-4999) ---

func ErrorErrorReasonForbidden added in v0.2.13

func ErrorErrorReasonForbidden(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonGatewayTimeout added in v0.2.13

func ErrorErrorReasonGatewayTimeout(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonInternalServerError added in v0.2.13

func ErrorErrorReasonInternalServerError(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonInvalidParameter added in v0.2.13

func ErrorErrorReasonInvalidParameter(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonInvalidState added in v0.2.13

func ErrorErrorReasonInvalidState(format string, args ...interface{}) *errors.Error

--- Common Business Logic Errors (3000-3999) ---

func ErrorErrorReasonMethodNotAllowed added in v0.2.13

func ErrorErrorReasonMethodNotAllowed(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonMissingParameter added in v0.2.13

func ErrorErrorReasonMissingParameter(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonNotFound added in v0.2.13

func ErrorErrorReasonNotFound(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonOperationNotAllowed added in v0.2.13

func ErrorErrorReasonOperationNotAllowed(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonRecordNotFound added in v0.2.13

func ErrorErrorReasonRecordNotFound(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonRegistryNotFound added in v0.2.13

func ErrorErrorReasonRegistryNotFound(format string, args ...interface{}) *errors.Error

--- Common Registry Errors (6000-6999) ---

func ErrorErrorReasonRequestTimeout added in v0.2.13

func ErrorErrorReasonRequestTimeout(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonResourceExists added in v0.2.13

func ErrorErrorReasonResourceExists(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonResourceInUse added in v0.2.13

func ErrorErrorReasonResourceInUse(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonServiceUnavailable added in v0.2.13

func ErrorErrorReasonServiceUnavailable(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonTooManyRequests added in v0.2.13

func ErrorErrorReasonTooManyRequests(format string, args ...interface{}) *errors.Error

func ErrorErrorReasonUnauthenticated added in v0.2.13

func ErrorErrorReasonUnauthenticated(format string, args ...interface{}) *errors.Error

--- Common Authentication & Authorization Errors (1000-1999) ---

func ErrorErrorReasonUnknownUnspecified added in v0.2.13

func ErrorErrorReasonUnknownUnspecified(format string, args ...interface{}) *errors.Error

--- General Framework Errors (0-999) ---

func ErrorErrorReasonValidationError added in v0.2.13

func ErrorErrorReasonValidationError(format string, args ...interface{}) *errors.Error

func IsErrorReasonAborted added in v0.2.13

func IsErrorReasonAborted(err error) bool

func IsErrorReasonCancelled added in v0.2.13

func IsErrorReasonCancelled(err error) bool

func IsErrorReasonConflict added in v0.2.13

func IsErrorReasonConflict(err error) bool

func IsErrorReasonConstraintViolation added in v0.2.13

func IsErrorReasonConstraintViolation(err error) bool

func IsErrorReasonDatabaseConnectionFailed added in v0.2.13

func IsErrorReasonDatabaseConnectionFailed(err error) bool

func IsErrorReasonDatabaseError added in v0.2.13

func IsErrorReasonDatabaseError(err error) bool

--- Common Database Errors (2000-2999) ---

func IsErrorReasonDuplicateKey added in v0.2.13

func IsErrorReasonDuplicateKey(err error) bool

func IsErrorReasonExternalServiceError added in v0.2.13

func IsErrorReasonExternalServiceError(err error) bool

func IsErrorReasonExternalServiceUnavailable added in v0.2.13

func IsErrorReasonExternalServiceUnavailable(err error) bool

--- Common External Service Errors (4000-4999) ---

func IsErrorReasonForbidden added in v0.2.13

func IsErrorReasonForbidden(err error) bool

func IsErrorReasonGatewayTimeout added in v0.2.13

func IsErrorReasonGatewayTimeout(err error) bool

func IsErrorReasonInternalServerError added in v0.2.13

func IsErrorReasonInternalServerError(err error) bool

func IsErrorReasonInvalidParameter added in v0.2.13

func IsErrorReasonInvalidParameter(err error) bool

func IsErrorReasonInvalidState added in v0.2.13

func IsErrorReasonInvalidState(err error) bool

--- Common Business Logic Errors (3000-3999) ---

func IsErrorReasonMethodNotAllowed added in v0.2.13

func IsErrorReasonMethodNotAllowed(err error) bool

func IsErrorReasonMissingParameter added in v0.2.13

func IsErrorReasonMissingParameter(err error) bool

func IsErrorReasonNotFound added in v0.2.13

func IsErrorReasonNotFound(err error) bool

func IsErrorReasonOperationNotAllowed added in v0.2.13

func IsErrorReasonOperationNotAllowed(err error) bool

func IsErrorReasonRecordNotFound added in v0.2.13

func IsErrorReasonRecordNotFound(err error) bool

func IsErrorReasonRegistryNotFound added in v0.2.13

func IsErrorReasonRegistryNotFound(err error) bool

--- Common Registry Errors (6000-6999) ---

func IsErrorReasonRequestTimeout added in v0.2.13

func IsErrorReasonRequestTimeout(err error) bool

func IsErrorReasonResourceExists added in v0.2.13

func IsErrorReasonResourceExists(err error) bool

func IsErrorReasonResourceInUse added in v0.2.13

func IsErrorReasonResourceInUse(err error) bool

func IsErrorReasonServiceUnavailable added in v0.2.13

func IsErrorReasonServiceUnavailable(err error) bool

func IsErrorReasonTooManyRequests added in v0.2.13

func IsErrorReasonTooManyRequests(err error) bool

func IsErrorReasonUnauthenticated added in v0.2.13

func IsErrorReasonUnauthenticated(err error) bool

--- Common Authentication & Authorization Errors (1000-1999) ---

func IsErrorReasonUnknownUnspecified added in v0.2.13

func IsErrorReasonUnknownUnspecified(err error) bool

--- General Framework Errors (0-999) ---

func IsErrorReasonValidationError added in v0.2.13

func IsErrorReasonValidationError(err error) bool

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_ERROR_CATEGORY_GENERAL_UNSPECIFIED ErrorCategory = 0
	// Authentication and authorization related errors.
	ErrorCategory_ERROR_CATEGORY_AUTHENTICATION ErrorCategory = 1
	// Database related errors.
	ErrorCategory_ERROR_CATEGORY_DATABASE ErrorCategory = 2
	// Business logic related errors.
	ErrorCategory_ERROR_CATEGORY_BUSINESS ErrorCategory = 3
	// External service related errors.
	ErrorCategory_ERROR_CATEGORY_EXTERNAL_SERVICE ErrorCategory = 4
)

func (ErrorCategory) Descriptor

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 (ErrorCategory) String

func (x ErrorCategory) String() string

func (ErrorCategory) Type

type ErrorMetadata

type ErrorMetadata struct {

	// The category of the error.
	Category ErrorCategory `protobuf:"varint,1,opt,name=category,proto3,enum=runtime.api.config.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

Cause function returns cause value.

func (ErrorMetadataValidationError) Error

Error satisfies the builtin error interface

func (ErrorMetadataValidationError) ErrorName

func (e ErrorMetadataValidationError) ErrorName() string

ErrorName returns error name.

func (ErrorMetadataValidationError) Field

Field function returns field value.

func (ErrorMetadataValidationError) Key

Key function returns key value.

func (ErrorMetadataValidationError) Reason

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_ERROR_REASON_UNKNOWN_UNSPECIFIED   ErrorReason = 0
	ErrorReason_ERROR_REASON_VALIDATION_ERROR      ErrorReason = 1
	ErrorReason_ERROR_REASON_NOT_FOUND             ErrorReason = 2
	ErrorReason_ERROR_REASON_INTERNAL_SERVER_ERROR ErrorReason = 3
	ErrorReason_ERROR_REASON_METHOD_NOT_ALLOWED    ErrorReason = 4
	ErrorReason_ERROR_REASON_REQUEST_TIMEOUT       ErrorReason = 5
	ErrorReason_ERROR_REASON_CONFLICT              ErrorReason = 6
	ErrorReason_ERROR_REASON_TOO_MANY_REQUESTS     ErrorReason = 7
	ErrorReason_ERROR_REASON_SERVICE_UNAVAILABLE   ErrorReason = 8
	ErrorReason_ERROR_REASON_GATEWAY_TIMEOUT       ErrorReason = 9
	// --- Common Authentication & Authorization Errors (1000-1999) ---
	ErrorReason_ERROR_REASON_UNAUTHENTICATED ErrorReason = 1000
	ErrorReason_ERROR_REASON_FORBIDDEN       ErrorReason = 1001
	// --- Common Database Errors (2000-2999) ---
	ErrorReason_ERROR_REASON_DATABASE_ERROR             ErrorReason = 2000
	ErrorReason_ERROR_REASON_RECORD_NOT_FOUND           ErrorReason = 2001
	ErrorReason_ERROR_REASON_CONSTRAINT_VIOLATION       ErrorReason = 2002
	ErrorReason_ERROR_REASON_DUPLICATE_KEY              ErrorReason = 2003
	ErrorReason_ERROR_REASON_DATABASE_CONNECTION_FAILED ErrorReason = 2004
	// --- Common Business Logic Errors (3000-3999) ---
	ErrorReason_ERROR_REASON_INVALID_STATE         ErrorReason = 3000
	ErrorReason_ERROR_REASON_RESOURCE_EXISTS       ErrorReason = 3001
	ErrorReason_ERROR_REASON_RESOURCE_IN_USE       ErrorReason = 3002
	ErrorReason_ERROR_REASON_CANCELLED             ErrorReason = 3003
	ErrorReason_ERROR_REASON_ABORTED               ErrorReason = 3004
	ErrorReason_ERROR_REASON_MISSING_PARAMETER     ErrorReason = 3005
	ErrorReason_ERROR_REASON_INVALID_PARAMETER     ErrorReason = 3006
	ErrorReason_ERROR_REASON_OPERATION_NOT_ALLOWED ErrorReason = 3007
	// --- Common External Service Errors (4000-4999) ---
	ErrorReason_ERROR_REASON_EXTERNAL_SERVICE_UNAVAILABLE ErrorReason = 4000
	ErrorReason_ERROR_REASON_EXTERNAL_SERVICE_ERROR       ErrorReason = 4001
	// --- Common Registry Errors (6000-6999) ---
	ErrorReason_ERROR_REASON_REGISTRY_NOT_FOUND ErrorReason = 6000
)

func (ErrorReason) Descriptor

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

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

func (x *Pagination) GetExtra() map[string]*anypb.Any

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

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

Cause function returns cause value.

func (PaginationRequestValidationError) Error

Error satisfies the builtin error interface

func (PaginationRequestValidationError) ErrorName

ErrorName returns error name.

func (PaginationRequestValidationError) Field

Field function returns field value.

func (PaginationRequestValidationError) Key

Key function returns key value.

func (PaginationRequestValidationError) Reason

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

Error satisfies the builtin error interface

func (PaginationValidationError) ErrorName

func (e PaginationValidationError) ErrorName() string

ErrorName returns error name.

func (PaginationValidationError) Field

Field function returns field value.

func (PaginationValidationError) Key

Key function returns key value.

func (PaginationValidationError) Reason

func (e PaginationValidationError) 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