singleton

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchEntity    = errors.New("util/singleton: no such entity")
	ErrSingletonTooBig = errors.New("util/singleton: object too big to write")
)

Functions

func GzipReader

func GzipReader(rdr io.Reader) (io.Reader, error)

These two wrapper functions seem sadly needed, to launder method signature types

func GzipWriter

func GzipWriter(wtr io.Writer) io.WriteCloser

Types

type NewReaderFunc

type NewReaderFunc func(io.Reader) (io.Reader, error)

These types might already exist in pkg/io ?

type NewWriteCloserFunc

type NewWriteCloserFunc func(io.Writer) io.WriteCloser // gzip needs us to call it's .Close()

type Singleton

type Singleton struct {
	Value []byte `datastore:",noindex"`
}

type SingletonProvider

type SingletonProvider interface {
	// Functions can be nil; there are some gzip ones below.
	ReadSingleton(ctx context.Context, name string, f NewReaderFunc, ptr interface{}) error
	WriteSingleton(ctx context.Context, name string, f NewWriteCloserFunc, ptr interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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