pref

package
v0.0.0-...-612593d Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BundleID = "com.grahamgilbert.crypt"

Variables

This section is empty.

Functions

This section is empty.

Types

type Pref

type Pref struct {
	Runner utils.CmdRunner
}

func (*Pref) Delete

func (p *Pref) Delete(prefName string) error

Delete removes a preference from the system

func (*Pref) Get

func (p *Pref) Get(prefName string) (interface{}, error)

func (*Pref) GetArray

func (p *Pref) GetArray(prefName string) ([]string, error)

GetArray returns the value of a preference as an array

func (*Pref) GetBool

func (p *Pref) GetBool(prefName string) (bool, error)

GetBool returns the value of a preference as a bool

func (*Pref) GetInt

func (p *Pref) GetInt(prefName string) (int, error)

GetInt returns the value of a preference as an int

func (*Pref) GetString

func (p *Pref) GetString(prefName string) (string, error)

GetString returns the value of a preference as a string

func (*Pref) Set

func (p *Pref) Set(prefName string, prefValue interface{}) error

Set sets the value of a preference Why use defaults over cgo? It's simpler, and more reliable.

func (*Pref) SetArray

func (p *Pref) SetArray(prefName string, prefValue []string) error

SetArray sets the value of a preference as an array

func (*Pref) SetBool

func (p *Pref) SetBool(prefName string, value bool) error

SetBool sets the value of a preference as a bool

func (*Pref) SetInt

func (p *Pref) SetInt(prefName string, value int) error

SetInt sets the value of a preference as an int

func (*Pref) SetString

func (p *Pref) SetString(prefName string, value string) error

SetString sets the value of a preference as a string

type PrefInterface

type PrefInterface interface {
	Delete(prefName string) error
	GetString(prefName string) (string, error)
	GetBool(prefName string) (bool, error)
	GetInt(prefName string) (int, error)
	GetArray(prefName string) ([]string, error)
	SetString(prefName string, value string) error
	SetBool(prefName string, value bool) error
	SetInt(prefName string, value int) error
	SetArray(prefName string, prefValue []string) error
	Get(prefName string) (interface{}, error)
	Set(prefName string, value interface{}) error
}

func New

func New() PrefInterface

New creates a new Pref struct

Jump to

Keyboard shortcuts

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