paginationpb

package
v0.0.0-...-fcf2c48 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: BSD-4-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error_name = map[int32]string{
		0: "ERROR_UNSPECIFIED",
		1: "ERROR_PAGINATION_INVALID",
		2: "ERROR_PAGINATION_DIRECTION_INVALID",
		3: "ERROR_PAGINATION_PAGE_INVALID",
		4: "ERROR_PAGINATION_PAGE_SIZE_INVALID",
		5: "ERROR_PAGINATION_PAGE_TOKEN_INVALID",
	}
	Error_value = map[string]int32{
		"ERROR_UNSPECIFIED":                   0,
		"ERROR_PAGINATION_INVALID":            1,
		"ERROR_PAGINATION_DIRECTION_INVALID":  2,
		"ERROR_PAGINATION_PAGE_INVALID":       3,
		"ERROR_PAGINATION_PAGE_SIZE_INVALID":  4,
		"ERROR_PAGINATION_PAGE_TOKEN_INVALID": 5,
	}
)

Enum value maps for Error.

View Source
var (
	PaginationDirection_name = map[int32]string{
		0: "PAGINATION_DIRECTION_UNSPECIFIED",
		1: "PAGINATION_DIRECTION_NEXT",
		2: "PAGINATION_DIRECTION_PREV",
	}
	PaginationDirection_value = map[string]int32{
		"PAGINATION_DIRECTION_UNSPECIFIED": 0,
		"PAGINATION_DIRECTION_NEXT":        1,
		"PAGINATION_DIRECTION_PREV":        2,
	}
)

Enum value maps for PaginationDirection.

View Source
var File_genproto_pagination_v1_error_proto protoreflect.FileDescriptor
View Source
var File_genproto_pagination_v1_pagination_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CursorPagination

type CursorPagination struct {
	PageToken string              `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`                                 // Page token.
	PageSize  int32               `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`                                   // Page size.
	Direction PaginationDirection `protobuf:"varint,3,opt,name=direction,proto3,enum=genproto.pagination.v1.PaginationDirection" json:"direction,omitempty"` // Direction.
	// contains filtered or unexported fields
}

func (*CursorPagination) Descriptor deprecated

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

Deprecated: Use CursorPagination.ProtoReflect.Descriptor instead.

func (*CursorPagination) GetDirection

func (x *CursorPagination) GetDirection() PaginationDirection

func (*CursorPagination) GetPageSize

func (x *CursorPagination) GetPageSize() int32

func (*CursorPagination) GetPageToken

func (x *CursorPagination) GetPageToken() string

func (*CursorPagination) ProtoMessage

func (*CursorPagination) ProtoMessage()

func (*CursorPagination) ProtoReflect

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

func (*CursorPagination) Reset

func (x *CursorPagination) Reset()

func (*CursorPagination) String

func (x *CursorPagination) String() string

type CursorPaginationResponse

type CursorPaginationResponse struct {
	Total     int32  `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`                         // Total.
	PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // Page token.
	Next      bool   `protobuf:"varint,3,opt,name=next,proto3" json:"next,omitempty"`                           // Is there a next page?
	Prev      bool   `protobuf:"varint,4,opt,name=prev,proto3" json:"prev,omitempty"`                           // Is there a previous page?
	// contains filtered or unexported fields
}

func (*CursorPaginationResponse) Descriptor deprecated

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

Deprecated: Use CursorPaginationResponse.ProtoReflect.Descriptor instead.

func (*CursorPaginationResponse) GetNext

func (x *CursorPaginationResponse) GetNext() bool

func (*CursorPaginationResponse) GetPageToken

func (x *CursorPaginationResponse) GetPageToken() string

func (*CursorPaginationResponse) GetPrev

func (x *CursorPaginationResponse) GetPrev() bool

func (*CursorPaginationResponse) GetTotal

func (x *CursorPaginationResponse) GetTotal() int32

func (*CursorPaginationResponse) ProtoMessage

func (*CursorPaginationResponse) ProtoMessage()

func (*CursorPaginationResponse) ProtoReflect

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

func (*CursorPaginationResponse) Reset

func (x *CursorPaginationResponse) Reset()

func (*CursorPaginationResponse) String

func (x *CursorPaginationResponse) String() string

type CursorPaginationValidator

type CursorPaginationValidator interface {
	Validate(req *CursorPagination) []*errdetails.BadRequest_FieldViolation
	ValidateDirection(direction_ PaginationDirection) *errdetails.BadRequest_FieldViolation
	ValidatePageToken(pageToken_ string) *errdetails.BadRequest_FieldViolation
	ValidatePageSize(pageSize_ int32) *errdetails.BadRequest_FieldViolation

	Optional() CursorPaginationValidator
	WithRuleDirection(rule validator.NumberRule[int32]) CursorPaginationValidator
	WithRulePageToken(rule validator.StringRule) CursorPaginationValidator
	WithRulePageSize(rule validator.NumberRule[int32]) CursorPaginationValidator
}

func NewCursorPaginationValidator

func NewCursorPaginationValidator() CursorPaginationValidator

type Error

type Error int32
const (
	Error_ERROR_UNSPECIFIED                   Error = 0
	Error_ERROR_PAGINATION_INVALID            Error = 1
	Error_ERROR_PAGINATION_DIRECTION_INVALID  Error = 2
	Error_ERROR_PAGINATION_PAGE_INVALID       Error = 3
	Error_ERROR_PAGINATION_PAGE_SIZE_INVALID  Error = 4
	Error_ERROR_PAGINATION_PAGE_TOKEN_INVALID Error = 5
)

func (Error) Descriptor

func (Error) Descriptor() protoreflect.EnumDescriptor

func (Error) Enum

func (x Error) Enum() *Error

func (Error) EnumDescriptor deprecated

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

Deprecated: Use Error.Descriptor instead.

func (Error) Number

func (x Error) Number() protoreflect.EnumNumber

func (Error) String

func (x Error) String() string

func (Error) Type

func (Error) Type() protoreflect.EnumType

type PagePagination

type PagePagination struct {
	Page     int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`                         // Page.
	PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // Page size.
	// contains filtered or unexported fields
}

func (*PagePagination) Descriptor deprecated

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

Deprecated: Use PagePagination.ProtoReflect.Descriptor instead.

func (*PagePagination) GetPage

func (x *PagePagination) GetPage() int32

func (*PagePagination) GetPageSize

func (x *PagePagination) GetPageSize() int32

func (*PagePagination) ProtoMessage

func (*PagePagination) ProtoMessage()

func (*PagePagination) ProtoReflect

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

func (*PagePagination) Reset

func (x *PagePagination) Reset()

func (*PagePagination) String

func (x *PagePagination) String() string

type PagePaginationResponse

type PagePaginationResponse struct {
	Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` // Total.
	Next  bool  `protobuf:"varint,2,opt,name=next,proto3" json:"next,omitempty"`   // Is there a next page?
	Prev  bool  `protobuf:"varint,3,opt,name=prev,proto3" json:"prev,omitempty"`   // Is there a previous page?
	// contains filtered or unexported fields
}

func (*PagePaginationResponse) Descriptor deprecated

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

Deprecated: Use PagePaginationResponse.ProtoReflect.Descriptor instead.

func (*PagePaginationResponse) GetNext

func (x *PagePaginationResponse) GetNext() bool

func (*PagePaginationResponse) GetPrev

func (x *PagePaginationResponse) GetPrev() bool

func (*PagePaginationResponse) GetTotal

func (x *PagePaginationResponse) GetTotal() int32

func (*PagePaginationResponse) ProtoMessage

func (*PagePaginationResponse) ProtoMessage()

func (*PagePaginationResponse) ProtoReflect

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

func (*PagePaginationResponse) Reset

func (x *PagePaginationResponse) Reset()

func (*PagePaginationResponse) String

func (x *PagePaginationResponse) String() string

type PagePaginationValidator

type PagePaginationValidator interface {
	Validate(req *PagePagination) []*errdetails.BadRequest_FieldViolation
	ValidatePage(page_ int32) *errdetails.BadRequest_FieldViolation
	ValidatePageSize(pageSize_ int32) *errdetails.BadRequest_FieldViolation

	Optional() PagePaginationValidator
	WithRulePage(rule validator.NumberRule[int32]) PagePaginationValidator
	WithRulePageSize(rule validator.NumberRule[int32]) PagePaginationValidator
}

func NewPagePaginationValidator

func NewPagePaginationValidator() PagePaginationValidator

type Pagination

type Pagination struct {

	// Types that are assignable to Pagination:
	//
	//	*Pagination_Cursor
	//	*Pagination_Page
	Pagination isPagination_Pagination `protobuf_oneof:"pagination"`
	// contains filtered or unexported fields
}

func (*Pagination) Descriptor deprecated

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

Deprecated: Use Pagination.ProtoReflect.Descriptor instead.

func (*Pagination) GetCursor

func (x *Pagination) GetCursor() *CursorPagination

func (*Pagination) GetPage

func (x *Pagination) GetPage() *PagePagination

func (*Pagination) GetPagination

func (m *Pagination) GetPagination() isPagination_Pagination

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

type PaginationDirection

type PaginationDirection int32
const (
	PaginationDirection_PAGINATION_DIRECTION_UNSPECIFIED PaginationDirection = 0 // —
	PaginationDirection_PAGINATION_DIRECTION_NEXT        PaginationDirection = 1 // Next.
	PaginationDirection_PAGINATION_DIRECTION_PREV        PaginationDirection = 2 // Previous.
)

func (PaginationDirection) Descriptor

func (PaginationDirection) Enum

func (PaginationDirection) EnumDescriptor deprecated

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

Deprecated: Use PaginationDirection.Descriptor instead.

func (PaginationDirection) Number

func (PaginationDirection) String

func (x PaginationDirection) String() string

func (PaginationDirection) Type

type PaginationValidator

type PaginationValidator interface {
	Validate(req *Pagination) []*errdetails.BadRequest_FieldViolation
	ValidateCursor(cursor_ *CursorPagination) []*errdetails.BadRequest_FieldViolation
	ValidatePage(page_ *PagePagination) []*errdetails.BadRequest_FieldViolation

	Optional() PaginationValidator
	WithRuleCursor(v CursorPaginationValidator) PaginationValidator
	WithRulePage(v PagePaginationValidator) PaginationValidator
}

func NewPaginationValidator

func NewPaginationValidator() PaginationValidator

type Pagination_Cursor

type Pagination_Cursor struct {
	Cursor *CursorPagination `protobuf:"bytes,1,opt,name=cursor,proto3,oneof"` // Cursor.
}

type Pagination_Page

type Pagination_Page struct {
	Page *PagePagination `protobuf:"bytes,2,opt,name=page,proto3,oneof"` // Page.
}

Jump to

Keyboard shortcuts

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