Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCursor = errors.New("invalid cursor") ErrInvalidModel = errors.New("invalid model") )
Errors for encoder
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct { After *string `json:"after" query:"after"` Before *string `json:"before" query:"before"` }
Cursor cursor data
type CustomType ¶ added in v2.3.0
type CustomType interface { // GetCustomTypeValue returns the value corresponding to the meta attribute inside the custom type. GetCustomTypeValue(meta interface{}) (interface{}, error) }
CustomType is an interface that custom types need to implement in order to allow pagination over fields inside custom types.
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder cursor decoder
func NewDecoder ¶
func NewDecoder(fields []DecoderField) *Decoder
NewDecoder creates cursor decoder for model
func (*Decoder) Decode ¶
Decode decodes cursor into values (without pointer) by referencing field type on model.
func (*Decoder) DecodeStruct ¶
DecodeStruct decodes cursor into model, model must be a pointer to struct or it will panic.
type DecoderField ¶ added in v2.3.0
DecoderField contains information about one decoder field.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder cursor encoder
type EncoderField ¶ added in v2.3.0
type EncoderField struct { Key string // metas are needed for handling of custom types Meta interface{} }
EncoderField contains information about one encoder field.
Click to show internal directories.
Click to hide internal directories.