base

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

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

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

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

func Base64

func Base64() Encoder

type Marshaller

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) (map[string]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 MsgPack

func MsgPack() Marshaller

Jump to

Keyboard shortcuts

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