config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "Spice"

ServiceName is the name of the service.

Variables

View Source
var AppVersion string // Or get it from version.txt during build

AppVersion is the version of the service.

Functions

func GetPath

func GetPath() string

GetPath returns the path to the user's config directory

Types

type Config

type Config struct {
	ImageQueries []ImageQuery `json:"query_urls"`
	// contains filtered or unexported fields
}

Config struct to hold all configuration data

func GetConfig

func GetConfig(p fyne.Preferences) *Config

GetConfig returns the singleton instance of Config.

func (*Config) AddImageQuery added in v0.2.1

func (c *Config) AddImageQuery(desc, url string, active bool)

AddImageQuery adds a new image query to the end of the list

func (*Config) DisableImageQuery added in v0.2.1

func (c *Config) DisableImageQuery(index int) error

DisableImageQuery disables the image query with the specified description

func (*Config) EnableImageQuery added in v0.2.1

func (c *Config) EnableImageQuery(index int) error

EnableImageQuery enables the image query with the specified description

func (*Config) RemoveImageQuery added in v0.2.1

func (c *Config) RemoveImageQuery(index int) error

RemoveImageQuery removes the image query with the specified description

type ImageQuery added in v0.2.1

type ImageQuery struct {
	Description string `json:"desc"`
	URL         string `json:"url"`
	Active      bool   `json:"active"`
}

ImageQuery struct to hold the URL of an image and whether it is active

Jump to

Keyboard shortcuts

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