cursor

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cursor

type Cursor struct {
	Limit int
	Type  Type
	Value interface{}
}

type Encoder added in v1.0.3

type Encoder interface {
	// When input is nil, must return an empty string
	Encode(input []byte) ([]byte, error)

	// When encoded is an empty string, return value must be nil
	Decode(encoded []byte) ([]byte, error)
}

Used to manipulate the output of the Marshaller (convert to base64 for portability or encrypt the cursor)

func Base64 added in v1.0.3

func Base64(encoding *base64.Encoding) Encoder

type Marshaller added in v1.0.3

type Marshaller interface {
	// When input is nil, must return an empty string
	Marshal(input interface{}) ([]byte, error)

	// When encoded is an empty string, return value must be nil
	Unmarshal(encoded []byte) (interface{}, error)
}

Used to transform the driver cursor representation (can be any type, most likely a literal, array or map) into a "string" (that will be converted to a portable format through the Encoder). Keep this as simple as possible

func Chain added in v1.0.3

func Chain(m Marshaller, es ...Encoder) Marshaller

func MsgPack added in v1.0.3

func MsgPack() Marshaller

type Type

type Type int
const (
	Before Type = 1 << iota
	After
)

Jump to

Keyboard shortcuts

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