Storage

Storage persists the per-target-set state (session token, cache and nag state).

On this page

Storage persists the per-target-set state (session token, cache and nag state). Keys are targets_hash values; data is the PROTOCOL §8 JSON document. Implementations must be safe for concurrent use.

type Storage interface {
	Read(key string) ([]byte, error)
	Write(key string, data []byte) error
}

Methods#

Read#

Read(key string) ([]byte, error)

Read returns the stored document, or (nil, nil) when there is none.

Write#

Write(key string, data []byte) error

Write replaces the stored document atomically.