Documentation
¶
Overview ¶
Package storage provides instance-scoped paths and credentials for music plugins.
Index ¶
Constants ¶
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 ¶
HostCachePath looks up an old in-process cache entry for migration.
func LegacyCachePath ¶
LegacyCachePath locates an existing file in the app's original cache layout.
func LegacyDataPath ¶
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 ¶
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 (Scope) Credential ¶
func (s Scope) Credential(name string) Credential
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.