config

package
v0.0.0-...-ba0afea Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Repositories         []*Repository          `json:"repositories"`
	ExternalApplications []*ExternalApplication `json:"external-applications"`
	DateFormat           string                 `json:"date-format"`
	PathColumnWidth      int                    `json:"path-column-width"`
}

Config : The main config type

func NewConfig

func NewConfig() *Config

NewConfig creates a new config

func (*Config) AddExternalApplication

func (c *Config) AddExternalApplication(name, command, argument string)

AddExternalApplication adds an external application

func (*Config) AddRepository

func (c *Config) AddRepository(path, imagePath string, isFavorite bool)

AddRepository adds a new repository

func (*Config) ClearExternalApplications

func (c *Config) ClearExternalApplications()

ClearExternalApplications clears the slice of external applications

func (*Config) ClearRepositories

func (c *Config) ClearRepositories()

ClearRepositories clears the slice of repositories

func (*Config) GetConfigPath

func (c *Config) GetConfigPath(configPath string) string

GetConfigPath returns the path to the config file

func (*Config) GetExternalApplicationByName

func (c *Config) GetExternalApplicationByName(name string) *ExternalApplication

GetExternalApplicationByName gets an external application by name

func (*Config) Load

func (c *Config) Load(configPath string) (err error)

Load loads the configuration file

func (*Config) RemoveExternalApplication

func (c *Config) RemoveExternalApplication(name string)

RemoveExternalApplication adds a new extenal application

func (*Config) RemoveRepository

func (c *Config) RemoveRepository(path string)

RemoveRepository adds a new repository

func (*Config) Save

func (c *Config) Save(configPath string)

Save saves a SoftTube configuration file

type ExternalApplication

type ExternalApplication struct {
	Name     string `json:"name"`
	Command  string `json:"command"`
	Argument string `json:"argument"`
}

ExternalApplication : An external application in the config

type Repository

type Repository struct {
	Path       string `json:"path"`
	ImagePath  string `json:"image-path"`
	IsFavorite bool   `json:"is-favorite"`
}

Repository : A Repository in the config

Jump to

Keyboard shortcuts

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