deploy

package
v2.16.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package deploy implements deployment of binaries and services to a Constellation instance.

It is used by the debugd.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Download

type Download struct {
	// contains filtered or unexported fields
}

Download downloads a bootstrapper from a given debugd instance.

func New

func New(log *slog.Logger, dialer NetDialer, serviceManager serviceManager,
	transfer fileTransferer, info infoSetter,
) *Download

New creates a new Download.

func (*Download) DownloadDeployment

func (d *Download) DownloadDeployment(ctx context.Context, ip string) error

DownloadDeployment will open a new grpc connection to another instance, attempting to download files from that instance.

func (*Download) DownloadInfo added in v2.3.0

func (d *Download) DownloadInfo(ctx context.Context, ip string) error

DownloadInfo will try to download the info from another instance.

type NetDialer

type NetDialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

NetDialer can open a net.Conn.

type ServiceManager

type ServiceManager struct {
	// contains filtered or unexported fields
}

ServiceManager receives ServiceManagerRequests and units via channels and performs the requests / creates the unit files.

func NewServiceManager

func NewServiceManager(log *slog.Logger) *ServiceManager

NewServiceManager creates a new ServiceManager.

func (*ServiceManager) OverrideServiceUnitExecStart added in v2.6.0

func (s *ServiceManager) OverrideServiceUnitExecStart(ctx context.Context, unitName, execStart string) error

OverrideServiceUnitExecStart will override the ExecStart of a systemd unit.

func (*ServiceManager) SystemdAction

func (s *ServiceManager) SystemdAction(ctx context.Context, request ServiceManagerRequest) error

SystemdAction will perform a systemd action on a service unit (start, stop, restart, reload).

func (*ServiceManager) WriteSystemdUnitFile

func (s *ServiceManager) WriteSystemdUnitFile(ctx context.Context, unit SystemdUnit) error

WriteSystemdUnitFile will write a systemd unit to disk.

type ServiceManagerRequest

type ServiceManagerRequest struct {
	Unit   string
	Action SystemdAction
}

ServiceManagerRequest describes a requested ServiceManagerAction to be performed on a specified service unit.

type SystemdAction

type SystemdAction uint32

SystemdAction encodes the available actions.

const (
	// Unknown is the default SystemdAction and does nothing.
	Unknown SystemdAction = iota
	// Start a systemd service.
	Start
	// Stop a systemd service.
	Stop
	// Restart a systemd service.
	Restart
	// Reload a systemd service.
	Reload
)

func (SystemdAction) String

func (i SystemdAction) String() string

type SystemdUnit

type SystemdUnit struct {
	Name     string `yaml:"name"`
	Contents string `yaml:"contents"`
}

SystemdUnit describes a systemd service file including the unit name and contents.

Jump to

Keyboard shortcuts

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