storage

package
v0.0.0-...-0d32183 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTTL of 1 day
	DefaultTTL = 24 * time.Hour
	// ErrorNeedleIsNil is used when the Set method receives a nil pointer
	ErrorNeedleIsNil = errors.Error("Cannot Set a nil *Needle")
	// ErrorStoreFull is used when the Set method receives a nil pointer
	ErrorStoreFull = errors.Error("Store is full")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Closer

type Closer interface {
	Close() error
}

Closer takes no arguments and returns an error. The purpose is to allow a signal to be passed to a storage

type GetSetCloser

type GetSetCloser interface {
	Getter
	Setter
	Closer
}

GetSetCloser is the primary interface used by the haystack server, it allows for Getting, Setting, and Closings

type Getter

type Getter interface {
	Get(hash needle.Hash) (*needle.Needle, error)
}

Getter takes a needle.Hash and returns a reference to needle.Needle and an error. The purpose is to provide a storage interface for getting a Needle by a Hash value

type Setter

type Setter interface {
	Set(needle *needle.Needle) error
}

Setter takes a needle.Needle reference and returns an error The purpose is to write a needle to storage and return an error if any issues arise.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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