config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "unknown"

Version contains the version of ALR. If the version isn't known, it'll be set to "unknown"

Functions

func Config deprecated

func Config(ctx context.Context) *types.Config

Config returns a ALR configuration struct. The first time it's called, it'll load the config from a file. Subsequent calls will just return the same value.

Deprecated: use struct method

func Language

func Language(ctx context.Context) language.Tag

Language returns the system language. The first time it's called, it'll detect the langauge based on the $LANG environment variable. Subsequent calls will just return the same value.

func SystemLang

func SystemLang() string

SystemLang returns the system language based on the $LANG environment variable.

Types

type ALRConfig

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

func GetInstance deprecated

func GetInstance(ctx context.Context) *ALRConfig

Deprecated: For legacy only

func New

func New() *ALRConfig

func (*ALRConfig) AutoPull

func (c *ALRConfig) AutoPull(ctx context.Context) bool

func (*ALRConfig) GetPaths

func (c *ALRConfig) GetPaths(ctx context.Context) *Paths

func (*ALRConfig) IgnorePkgUpdates

func (c *ALRConfig) IgnorePkgUpdates(ctx context.Context) []string

func (*ALRConfig) Load

func (c *ALRConfig) Load(ctx context.Context)

func (*ALRConfig) Repos

func (c *ALRConfig) Repos(ctx context.Context) []types.Repo

type Paths

type Paths struct {
	ConfigDir  string
	ConfigPath string
	CacheDir   string
	RepoDir    string
	PkgsDir    string
	DBPath     string
}

Paths contains various paths used by ALR

func GetPaths deprecated

func GetPaths(ctx context.Context) *Paths

GetPaths returns a Paths struct. The first time it's called, it'll generate the struct using information from the system. Subsequent calls will return the same value.

Deprecated: use struct API

Jump to

Keyboard shortcuts

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