storage

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = errors.New("already exists")
	ErrNotFound      = errors.New("not found")
)

Functions

func IsAlreadyExists

func IsAlreadyExists(err error) bool

func IsNotFound

func IsNotFound(err error) bool

Types

type AgentSources

type AgentSources interface {
	List() ([]models.AgentSource, error)
	Get(id uuid.UUID) (*models.AgentSource, error)
	Set(src *models.AgentSource) error
	Delete(id uuid.UUID) error
}

AgentSources holds the named, reusable agent-binary deploy presets (see models.AgentSource) — a flat collection, not scoped to any one server.

type Auth

type Auth interface {
	Get() (*models.AuthCredentials, error)
	Set(creds *models.AuthCredentials) error
}

Auth holds the single admin account used by the standalone web-server's login flow (see internal/api). Not a collection like Users/Servers — there's exactly one record.

type Interfaces

type Interfaces interface {
	List() ([]models.Interface, error)
	Get(id uuid.UUID) (*models.Interface, error)
	Set(iface *models.Interface) error
	Delete(id uuid.UUID) error
	UsedIPs(ifaceID uuid.UUID) ([]net.IPNet, error)
}

type Peers

type Peers interface {
	List() ([]models.Peer, error)
	Get(publicKey agentmodels.Key) (*models.Peer, error)
	Set(peer *models.Peer) error
	Delete(publicKey agentmodels.Key) error
}

type Servers

type Servers interface {
	List() ([]models.Server, error)
	Get(id uuid.UUID) (*models.Server, error)
	Set(srv *models.Server) error
	Delete(id uuid.UUID) error
	Interfaces(serverID uuid.UUID) Interfaces
}

type Storage

type Storage interface {
	io.Closer
	Users() Users
	Servers() Servers
	Auth() Auth
	AgentSources() AgentSources
	// Backup writes a consistent, restorable snapshot of the entire store to
	// w (see storage/boltdb/dump — the same format as the awg-migrate CLI).
	Backup(w io.Writer) error
}

type Users

type Users interface {
	List() ([]models.User, error)
	Get(id uuid.UUID) (*models.User, error)
	Set(user *models.User) error
	Delete(id uuid.UUID) error
	Peers(userID uuid.UUID) Peers
}

Directories

Path Synopsis
dump
Package dump reads/writes awg-admin's boltdb as a portable JSON snapshot of every bucket's raw key/value pairs — the format shared by the in-app backup (Service.Backup / the desktop "Backup" button / the standalone GET /backup) and the standalone awg-migrate CLI, so a backup taken from one can be restored with the other.
Package dump reads/writes awg-admin's boltdb as a portable JSON snapshot of every bucket's raw key/value pairs — the format shared by the in-app backup (Service.Backup / the desktop "Backup" button / the standalone GET /backup) and the standalone awg-migrate CLI, so a backup taken from one can be restored with the other.

Jump to

Keyboard shortcuts

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