stepkv

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package stepkv implements a tiny loopback HTTP key/value API backed by an in-memory TTL cache. It is intended for optional per-SSH-run scratch state (see honey cue-exec kv_tunnel).

Index

Constants

This section is empty.

Variables

View Source
var ErrBadKey = errors.New("stepkv: bad key")

ErrBadKey is returned when a key is empty, too long, contains '/', or is reserved.

View Source
var ErrValueTooLong = errors.New("stepkv: value too long")

ErrValueTooLong is returned when a value exceeds maxValueLen.

Functions

This section is empty.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is one loopback HTTP listener + ttlcache instance + auth token.

func Start

func Start(ttl time.Duration) (*Session, error)

Start spins a new session listening on loopback (random port).

func (*Session) Close

func (s *Session) Close() error

Close shuts down the HTTP server and cache.

func (*Session) Delete added in v0.2.9

func (s *Session) Delete(key string) error

Delete removes key if present.

func (*Session) Get added in v0.2.9

func (s *Session) Get(key string) (value string, found bool, err error)

Get returns the value for key and whether it was found.

func (*Session) LocalBaseURL

func (s *Session) LocalBaseURL() string

LocalBaseURL is the operator-side URL (loopback) for this session.

func (*Session) LocalTCPAddr

func (s *Session) LocalTCPAddr() string

LocalTCPAddr returns host:port for dialing the loopback listener (no scheme).

func (*Session) Put added in v0.2.9

func (s *Session) Put(key, value string) error

Put stores value for key.

func (*Session) Token

func (s *Session) Token() string

Token returns the bearer token required on requests.

Jump to

Keyboard shortcuts

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