package setup
import "github.com/purpleidea/mgmt/setup"
Package setup provides some simple facilities to help bootstrap things.
Index ¶
- type API
- type Config
- type Firstboot
- func (obj *Firstboot) Main(ctx context.Context) error
- func (obj *Firstboot) Run(ctx context.Context) error
- func (obj *Firstboot) Validate() error
- type Pkg
- func (obj *Pkg) Main(ctx context.Context) error
- func (obj *Pkg) Run(ctx context.Context) error
- func (obj *Pkg) Validate() error
- type Svc
Types ¶
type API ¶
API is the simple interface we expect for any setup items.
type Config ¶
type Config struct { }
Config is a struct of all the configuration values which are shared by all of the setup utilities. By including this as a separate struct, it can be used as part of the API if we want.
type Firstboot ¶
type Firstboot struct { *cliUtil.SetupFirstbootArgs // embedded config Config // embedded Config // Program is the name of this program, usually set at compile time. Program string // Version is the version of this program, usually set at compile time. Version string // Debug represents if we're running in debug mode or not. Debug bool // Logf is a logger which should be used. Logf func(format string, v ...interface{}) }
Firstboot is the standalone entry program for the firstboot setup component.
func (*Firstboot) Main ¶
Main runs everything for this setup item.
func (*Firstboot) Run ¶
Run performs the desired actions. This templates and installs a systemd service and enables and starts it if so desired.
func (*Firstboot) Validate ¶
Validate verifies that the structure has acceptable data stored within.
type Pkg ¶
type Pkg struct { *cliUtil.SetupPkgArgs // embedded config Config // embedded Config // Program is the name of this program, usually set at compile time. Program string // Version is the version of this program, usually set at compile time. Version string // Debug represents if we're running in debug mode or not. Debug bool // Logf is a logger which should be used. Logf func(format string, v ...interface{}) }
Pkg is the standalone entry program for the pkg setup component.
func (*Pkg) Main ¶
Main runs everything for this setup item.
func (*Pkg) Run ¶
Run performs the desired actions. This generates a list of bash commands to run since we might not be able to run this binary to install these packages! The output (stdout) of this command can be run from a shell.
func (*Pkg) Validate ¶
Validate verifies that the structure has acceptable data stored within.
type Svc ¶
type Svc struct { *cliUtil.SetupSvcArgs // embedded config Config // embedded Config // Program is the name of this program, usually set at compile time. Program string // Version is the version of this program, usually set at compile time. Version string // Debug represents if we're running in debug mode or not. Debug bool // Logf is a logger which should be used. Logf func(format string, v ...interface{}) }
Svc is the standalone entry program for the svc setup component.
func (*Svc) Main ¶
Main runs everything for this setup item.
func (*Svc) Run ¶
Run performs the desired actions. This templates and installs a systemd service and enables and starts it if so desired.
func (*Svc) Validate ¶
Validate verifies that the structure has acceptable data stored within.
Source Files ¶
firstboot.go pkg.go setup.go svc.go
- Version
- v0.0.0-20250322185616-c50a578426f1 (latest)
- Published
- Mar 22, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 4 days ago –
Tools for package owners.