moxio

package
v0.0.0-...-6670d34 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadOne

func LoadOne(ctx context.Context, uri, arg string) (interface{}, error)

func LoadOneMap

func LoadOneMap(ctx context.Context, uri, arg string) (map[string]interface{}, error)

func Save

func Save(ctx context.Context, uri, arg string, i interface{}) error

Types

type Iterator

type Iterator interface {
	// Next prepares the next row for reading. It returns true if there is another
	// row and false if no more rows are available.
	Next() bool
	// Read reads the given object/data with the row value.
	// It is an error to call Read without
	// first calling Next() and checking that it returned true.
	Read(context.Context) (interface{}, error)
	Close() error
}

func LoadIterator

func LoadIterator(ctx context.Context, uri, arg string) (Iterator, error)

func NewMemoryIterator

func NewMemoryIterator(objs []interface{}) Iterator

type Loader

type Loader interface {
	Iterator(ctx context.Context, arg string) (Iterator, error)
}

func NewLoader

func NewLoader(ctx context.Context, uri string) (Loader, error)

type Saver

type Saver interface {
	Save(context.Context, interface{}) error
}

func NewSaver

func NewSaver(_ context.Context, uri, arg string) (Saver, error)

Jump to

Keyboard shortcuts

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