mem

package
v0.0.0-...-113f59a Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

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) ReadState

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

ReadState implements the StateStore interface.

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.

Jump to

Keyboard shortcuts

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