mem

package
v1.106.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: BSD-3-Clause Imports: 7 Imported by: 28 modules, 28 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mem provides an in-memory ipn.StateStore implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New returns a new Store.

Types

type Store

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

Store is an ipn.StateStore that keeps state in memory only.

func (*Store) ExportToJSON

func (s *Store) ExportToJSON() ([]byte, error)

ExportToJSON exports the content of the cache to JSON formatted []byte.

func (*Store) LoadFromJSON

func (s *Store) LoadFromJSON(data []byte) error

LoadFromJSON attempts to unmarshal json content into the in-memory cache.

func (*Store) LoadFromMap added in v1.78.0

func (s *Store) LoadFromMap(m map[string][]byte)

LoadFromMap loads the in-memory cache from the provided map. Any existing content is cleared, and the provided map is copied into the cache.

func (*Store) ReadState

func (s *Store) ReadState(id ipn.StateKey) ([]byte, error)

ReadState implements the StateStore interface. It returns ipn.ErrStateNotExist if the state does not exist.

func (*Store) String

func (s *Store) String() string

func (*Store) WriteState

func (s *Store) WriteState(id ipn.StateKey, bs []byte) error

WriteState implements the StateStore interface. It never returns an error.

Jump to

Keyboard shortcuts

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