control

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Control

type Control struct {
	Name       string   `dpkg:"Package"`
	Version    string   `dpkg:"Version"`
	Section    string   `dpkg:"Section"`
	Priority   string   `dpkg:"Priority"`
	Arch       string   `dpkg:"Architecture"`
	Maintainer string   `dpkg:"Maintainer"`
	Essential  string   `dpkg:"Essential"`
	Homepage   string   `dpkg:"Homepage"`
	Size       string   `dpkg:"Installed-Size"`
	Depends    []string `dpkg:"Depends,omitempty"`
	Conflicts  []string `dpkg:"Conflicts,omitempty"`
	Provides   []string `dpkg:"Provides,omitempty"`
	Replaces   []string `dpkg:"Replaces,omitempty"`
	Desc       string   `dpkg:"Description"`
	LongDesc   string   `dpkg:"Text"`
}

Control represents a debian control file

func Default

func Default(name ...string) Control

Default returns a default control file, taking an optional argument for the name

func Parse

func Parse(data []byte) (Control, error)

Parse takes a control file contents and turns it into a control file struct.

func Read

func Read(fn string) (Control, error)

Read will read the given filename, parse it's contents and return a Control struct.

func (Control) Filename

func (c Control) Filename() string

Filename returns the name of the packages filename

func (Control) String

func (c Control) String() string

String returns the text contents of the control file

func (Control) Write

func (c Control) Write(w io.Writer) error

func (Control) WriteFile

func (c Control) WriteFile(fn string) error

WriteFile will write the control file to the given filename

Jump to

Keyboard shortcuts

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