Back to godoc.org
github.com/juju/packaging

package packaging

v0.0.0 (970596d)
Latest Go to latest
Published: Apr 21, 2020 | License: LGPL-3.0 | Module: github.com/juju/packaging

Overview

Package packaging abstracts away differences between package managers like apt and yum and allows for easy extension for other package managers/distros.

Index

type PackagePreferences

type PackagePreferences struct {
	Path        string // the file the prefs will be written at
	Explanation string // a short explanation for the preference
	Package     string // the name of the package the preference applies to
	Pin         string // a pin on a certain source
	Priority    int    // the priority of that source
}

PackagePreferences is a set of packaging preferences associated to a particular set of packages and repository. On apt-based systems, they are apt_preferences(5) compatible preferences for an apt source. It can be used to override the default priority for the source. Path where the file will be created (usually in /etc/apt/preferences.d/).

func (*PackagePreferences) RenderPreferenceFile

func (p *PackagePreferences) RenderPreferenceFile(fileTemplate *template.Template) (string, error)

RenderPreferenceFile returns contents of the package-manager specific config file of this paritcular package source.

type PackageSource

type PackageSource struct {
	Name string `yaml:"-"`
	URL  string `yaml:"source"`
	Key  string `yaml:"key,omitempty"`
}

PackageSource contains all the data required for a package source.

func (*PackageSource) KeyFileName

func (s *PackageSource) KeyFileName() string

KeyFileName returns the name of this source's keyfile.

func (*PackageSource) RenderSourceFile

func (s *PackageSource) RenderSourceFile(fileTemplate *template.Template) (string, error)

RenderSourceFile renders the current source based on a template it recieves.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier