keyvalue

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: CC0-1.0, CC0-1.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingDatabaseName = errors.New("missing database name")
	ErrMissingTableName    = errors.New("missing table name")
	ErrMalformedMessage    = errors.New("malformed message")
	ErrUnknownBackend      = errors.New("unknown backend")
	ErrInvalidDatabaseSpec = errors.New("invalid database specification")
	ErrMissingKey          = errors.New("key mismatch")
	ErrUnknownULID         = errors.New("unknown ULID")
)

errors

View Source
var Create = func(theseOpts *proxy.Options) (proxy.Handler, proxy.Teardown, error) {

	m.Lock()
	opts = theseOpts
	m.Unlock()

	return handler, teardown, nil
}

Create is the creation function for keyvalue endpoints

Functions

func AddDbURLFunc

func AddDbURLFunc(endpoint string, f DbURLFunc)

AddDbURLFunc adds the DbURLFunc f to the collection of known DbURLFuncs.

func AddDefaults

func AddDefaults(endpoint string, f DefaultsFunc)

AddDefaults adds the DefaultsFunc f, which should describe default values for endpoint, to the collection of known validators.

func ULIDFromRequest

func ULIDFromRequest(lg log.Interface, msg map[string]interface{}) (ulid string, err error)

ULIDFromRequest extracts the ULID from the request msg and returns it.

Types

type DbURLFunc

type DbURLFunc func(map[string]interface{}, *proxy.Options) (string, error)

DbURLFunc is a function that takes a database specification and proxy options and returns a URL specifying that database.

type DefaultsFunc

type DefaultsFunc func() map[string]interface{}

DefaultsFunc is a function that returns a JSON description of default values

Jump to

Keyboard shortcuts

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