config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 13 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 {
	RefreshInterval time.Duration `yaml:"refresh_interval"`
	PkgRepos        []*PkgRepo    `yaml:"pkg_repos"`
}

Config is a Webman config

func Load

func Load() (*Config, error)

Load loads the Webman Config

func (*Config) Save

func (c *Config) Save() error

Save saves the Config

type PkgRepo

type PkgRepo struct {
	Name   string      `yaml:"name"`
	Type   PkgRepoType `yaml:"type"`
	User   string      `yaml:"user"`
	Repo   string      `yaml:"repo"`
	Branch string      `yaml:"branch"`

	GiteaURL string `yaml:"gitea_url"`
}

PkgRepo is a package repository

func (PkgRepo) GroupPath added in v0.10.0

func (p PkgRepo) GroupPath() string

GroupPath is the filepath to a given PkgRepo's groups

func (PkgRepo) PackagePath added in v0.10.0

func (p PkgRepo) PackagePath() string

PackagePath is the filepath to a given PkgRepo's packages

func (PkgRepo) Path

func (p PkgRepo) Path() string

Path is the filepath to a given PkgRepo

func (PkgRepo) RefreshRecipes

func (p PkgRepo) RefreshRecipes() error

RefreshRecipes refreshes the recipes for a PkgRepo

func (PkgRepo) ShouldRefreshRecipes

func (p PkgRepo) ShouldRefreshRecipes(refreshInterval time.Duration) (bool, error)

ShouldRefreshRecipes determines whether a PkgRepo needs to be refreshed

func (PkgRepo) Validate

func (p PkgRepo) Validate() (bool, error)

Validate checks if a PkgRepo is valid

type PkgRepoType

type PkgRepoType string

PkgRepoType is the package repository type

const (
	PkgRepoTypeGitHub PkgRepoType = "github"
	PkgRepoTypeGitea  PkgRepoType = "gitea"
)

Jump to

Keyboard shortcuts

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