pagination

package
v0.0.0-...-d49c957 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Order_name = map[int32]string{
		0: "UNSORTED",
		1: "ASC",
		2: "DESC",
	}
	Order_value = map[string]int32{
		"UNSORTED": 0,
		"ASC":      1,
		"DESC":     2,
	}
)

Enum value maps for Order.

View Source
var File_pagination_pagination_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Order

type Order int32

分页排序

const (
	// 不排序
	Order_UNSORTED Order = 0
	// 升序
	Order_ASC Order = 1
	// 降序
	Order_DESC Order = 2
)

func (Order) Descriptor

func (Order) Descriptor() protoreflect.EnumDescriptor

func (Order) Enum

func (x Order) Enum() *Order

func (Order) EnumDescriptor deprecated

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

Deprecated: Use Order.Descriptor instead.

func (Order) Number

func (x Order) Number() protoreflect.EnumNumber

func (Order) String

func (x Order) String() string

func (Order) Type

func (Order) Type() protoreflect.EnumType

type PagingReply

type PagingReply struct {
	Total uint32       `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	Items []*anypb.Any `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

分页通用结果

func (*PagingReply) Descriptor deprecated

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

Deprecated: Use PagingReply.ProtoReflect.Descriptor instead.

func (*PagingReply) GetItems

func (x *PagingReply) GetItems() []*anypb.Any

func (*PagingReply) GetTotal

func (x *PagingReply) GetTotal() uint32

func (*PagingReply) ProtoMessage

func (*PagingReply) ProtoMessage()

func (*PagingReply) ProtoReflect

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

func (*PagingReply) Reset

func (x *PagingReply) Reset()

func (*PagingReply) String

func (x *PagingReply) String() string

func (*PagingReply) Validate

func (m *PagingReply) Validate() error

Validate checks the field values on PagingReply 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 (*PagingReply) ValidateAll

func (m *PagingReply) ValidateAll() error

ValidateAll checks the field values on PagingReply 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 PagingReplyMultiError, or nil if none found.

type PagingReplyMultiError

type PagingReplyMultiError []error

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

func (PagingReplyMultiError) AllErrors

func (m PagingReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PagingReplyMultiError) Error

func (m PagingReplyMultiError) Error() string

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

type PagingReplyValidationError

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

PagingReplyValidationError is the validation error returned by PagingReply.Validate if the designated constraints aren't met.

func (PagingReplyValidationError) Cause

Cause function returns cause value.

func (PagingReplyValidationError) Error

Error satisfies the builtin error interface

func (PagingReplyValidationError) ErrorName

func (e PagingReplyValidationError) ErrorName() string

ErrorName returns error name.

func (PagingReplyValidationError) Field

Field function returns field value.

func (PagingReplyValidationError) Key

Key function returns key value.

func (PagingReplyValidationError) Reason

Reason function returns reason value.

type PagingRequest

type PagingRequest struct {

	// 当前页
	Page *uint32 `protobuf:"varint,1,opt,name=page,proto3,oneof" json:"page,omitempty"`
	// 每一页的行数
	PageSize *uint32 `protobuf:"varint,2,opt,name=pageSize,proto3,oneof" json:"pageSize,omitempty"`
	// 查询参数
	Query map[string]string `` /* 151-byte string literal not displayed */
	// 排序
	OrderBy map[string]Order `` /* 178-byte string literal not displayed */
	// contains filtered or unexported fields
}

分页通用请求

func (*PagingRequest) Descriptor deprecated

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

Deprecated: Use PagingRequest.ProtoReflect.Descriptor instead.

func (*PagingRequest) GetOrderBy

func (x *PagingRequest) GetOrderBy() map[string]Order

func (*PagingRequest) GetPage

func (x *PagingRequest) GetPage() uint32

func (*PagingRequest) GetPageSize

func (x *PagingRequest) GetPageSize() uint32

func (*PagingRequest) GetQuery

func (x *PagingRequest) GetQuery() map[string]string

func (*PagingRequest) ProtoMessage

func (*PagingRequest) ProtoMessage()

func (*PagingRequest) ProtoReflect

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

func (*PagingRequest) Reset

func (x *PagingRequest) Reset()

func (*PagingRequest) String

func (x *PagingRequest) String() string

func (*PagingRequest) Validate

func (m *PagingRequest) Validate() error

Validate checks the field values on PagingRequest 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 (*PagingRequest) ValidateAll

func (m *PagingRequest) ValidateAll() error

ValidateAll checks the field values on PagingRequest 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 PagingRequestMultiError, or nil if none found.

type PagingRequestMultiError

type PagingRequestMultiError []error

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

func (PagingRequestMultiError) AllErrors

func (m PagingRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PagingRequestMultiError) Error

func (m PagingRequestMultiError) Error() string

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

type PagingRequestValidationError

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

PagingRequestValidationError is the validation error returned by PagingRequest.Validate if the designated constraints aren't met.

func (PagingRequestValidationError) Cause

Cause function returns cause value.

func (PagingRequestValidationError) Error

Error satisfies the builtin error interface

func (PagingRequestValidationError) ErrorName

func (e PagingRequestValidationError) ErrorName() string

ErrorName returns error name.

func (PagingRequestValidationError) Field

Field function returns field value.

func (PagingRequestValidationError) Key

Key function returns key value.

func (PagingRequestValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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