autostart

package
v2.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package autostart manage start at login unit files for darwin/linux

Package autostart manage start at login unit files for darwin/linux

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = fmt.Errorf("autostart is not supported on %s", runtime.GOOS)

Functions

func AutoStartedIdentifier

func AutoStartedIdentifier() string

AutoStartedIdentifier returns the identifier if the current process was started by the autostart manager.

func IsRegistered

func IsRegistered(ctx context.Context, inst *limatype.Instance) (bool, error)

IsRegistered checks if the instance is registered to start at login.

func Manager

func Manager() autoStartManager

Manager returns the autostart manager for Linux.

func RegisterToStartAtLogin

func RegisterToStartAtLogin(ctx context.Context, inst *limatype.Instance) error

RegisterToStartAtLogin creates a start-at-login entry for the instance.

func RequestStart

func RequestStart(ctx context.Context, inst *limatype.Instance) error

RequestStart requests to start the instance by identifier.

func RequestStop

func RequestStop(ctx context.Context, inst *limatype.Instance) (bool, error)

RequestStop requests to stop the instance by identifier.

func UnregisterFromStartAtLogin

func UnregisterFromStartAtLogin(ctx context.Context, inst *limatype.Instance) error

UnregisterFromStartAtLogin deletes the start-at-login entry for the instance.

Types

type TemplateFileBasedManager

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

TemplateFileBasedManager is an autostart manager that uses a template file to create the autostart entry.

func (*TemplateFileBasedManager) AutoStartedIdentifier

func (t *TemplateFileBasedManager) AutoStartedIdentifier() string

func (*TemplateFileBasedManager) IsRegistered

func (t *TemplateFileBasedManager) IsRegistered(_ context.Context, inst *limatype.Instance) (bool, error)

func (*TemplateFileBasedManager) RegisterToStartAtLogin

func (t *TemplateFileBasedManager) RegisterToStartAtLogin(ctx context.Context, inst *limatype.Instance) error

func (*TemplateFileBasedManager) RequestStart

func (t *TemplateFileBasedManager) RequestStart(ctx context.Context, inst *limatype.Instance) error

func (*TemplateFileBasedManager) RequestStop

func (t *TemplateFileBasedManager) RequestStop(ctx context.Context, inst *limatype.Instance) (bool, error)

func (*TemplateFileBasedManager) UnregisterFromStartAtLogin

func (t *TemplateFileBasedManager) UnregisterFromStartAtLogin(ctx context.Context, inst *limatype.Instance) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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