ppa

package
v0.0.0-...-4842e19 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ppa manages Private Package Archives sources list. It enables adding and removing a PPA on a system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasePPA

type BasePPA struct {
	*imagedefinition.PPA
	// contains filtered or unexported fields
}

BasePPA holds fields and methods common to every PPAPrivateInterface implementation

func (*BasePPA) FullName

func (p *BasePPA) FullName() string

type Deb822PPA

type Deb822PPA struct {
	BasePPA
}

Deb822PPA implements behaviors to manage PPA in the deb822 format, specifically: - write in a <ppa>.sources file, in the deb822 format - embed the signing key in the file itself

func (*Deb822PPA) FileContent

func (p *Deb822PPA) FileContent() (string, error)

func (*Deb822PPA) FileName

func (p *Deb822PPA) FileName() string

func (*Deb822PPA) ImportKey

func (p *Deb822PPA) ImportKey(basePath string, debug bool) error

func (*Deb822PPA) Remove

func (p *Deb822PPA) Remove(basePath string) error

type LegacyPPA

type LegacyPPA struct {
	BasePPA
}

LegacyPPA implements behaviors to manage PPA the legacy way, specifically: - write in a sources.list file - manage signing key with gpg in /etc/apt/trusted.gpg.d

func (*LegacyPPA) FileContent

func (p *LegacyPPA) FileContent() (string, error)

func (*LegacyPPA) FileName

func (p *LegacyPPA) FileName() string

func (*LegacyPPA) ImportKey

func (p *LegacyPPA) ImportKey(basePath string, debug bool) error

func (*LegacyPPA) Remove

func (p *LegacyPPA) Remove(basePath string) error

type PPA

type PPA struct {
	PPAPrivateInterface
}

PPA is a basic implementation of the PPAPrivateInterface enabling the implementation of common behaviors between LegacyPPA and Deb822PPA

func (*PPA) Add

func (p *PPA) Add(basePath string, debug bool) error

Add adds the PPA to the sources.list.d directory and imports the signing key.

type PPAInterface

type PPAInterface interface {
	Add(basePath string, debug bool) error
	Remove(basePath string) error
}

PPAInterface is the only interface that should be used outside of this package. It defines the behavior of a PPA.

func New

func New(imageDefPPA *imagedefinition.PPA, deb822 bool, series string) PPAInterface

New instantiates the proper PPA implementation based on the deb822 flag

type PPAPrivateInterface

type PPAPrivateInterface interface {
	FullName() string
	FileName() string
	FileContent() (string, error)
	ImportKey(basePath string, debug bool) error
	Remove(basePath string) error
}

PPAPrivateInterface defines internal behavior expected from a PPAInterface implementer. Even though methods are exporter, they are not meant to be used outside of this package.

Jump to

Keyboard shortcuts

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