storage

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: AGPL-3.0 Imports: 7 Imported by: ? modules, 0 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 storage provides instance-scoped paths and credentials for music plugins.

Index

Constants

View Source
const PathHostCache mygo.PathName = "wayguHostCache"

PathHostCache is set by the desktop runner when the host provides its old cache.

Variables

This section is empty.

Functions

func HostCachePath

func HostCachePath(name string) (string, error)

HostCachePath looks up an old in-process cache entry for migration.

func LegacyCachePath

func LegacyCachePath(name string) (string, error)

LegacyCachePath locates an existing file in the app's original cache layout.

func LegacyDataPath

func LegacyDataPath(name string) (string, error)

LegacyDataPath locates an existing file in the app's original data layout.

func UseCredentialService

func UseCredentialService(service string)

UseCredentialService sets the credential namespace before the plugin starts. An empty service uses the host profile's development credential files.

func WriteDataFile

func WriteDataFile(path string, data []byte) error

WriteDataFile replaces a settings or state file after writing it fully.

Types

type Credential

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

Credential stores opaque bytes in the system credential store. Development builds use a private file in the app's data directory.

func (Credential) Delete

func (c Credential) Delete() error

func (Credential) DeleteFile

func (c Credential) DeleteFile() error

func (Credential) Read

func (c Credential) Read() ([]byte, error)

func (Credential) ReadFile

func (c Credential) ReadFile() ([]byte, error)

ReadFile reads the private file for a plugin that supports an existing file fallback.

func (Credential) Write

func (c Credential) Write(data []byte) error

func (Credential) WriteFile

func (c Credential) WriteFile(data []byte) error

WriteFile replaces the private file after the complete record has been written.

type Scope

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

Scope identifies the files and credentials of one registered plugin instance.

func For

func For(id pluginapi.ID) Scope

func (Scope) CachePath

func (s Scope) CachePath(name string) (string, error)

func (Scope) Credential

func (s Scope) Credential(name string) Credential

func (Scope) DataPath

func (s Scope) DataPath(name string) (string, error)

func (Scope) LegacyCredential

func (s Scope) LegacyCredential(name, file string) Credential

LegacyCredential uses the original instance-prefixed key. file optionally supplies a development filename that predates the credential key.

Jump to

Keyboard shortcuts

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