daemon

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: BSD-3-Clause Imports: 15 Imported by: 7

README

cobra-daemon

Documentation

Overview

Copyright © 2024 Matt Krueger <mkrueger@rstms.net>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const Version = "0.1.0"

Variables

This section is empty.

Functions

func AddDaemonCommands added in v0.0.4

func AddDaemonCommands(rootCmd *cobra.Command, args ...string)

Types

type CobraDaemon added in v0.0.5

type CobraDaemon interface {
	Install() error
	Delete() error
	Start() error
	Stop() error
	GetConfig() (string, error)
	Query() (bool, error)
}

func NewDaemon

func NewDaemon(name, username, dir, command string, args ...string) (CobraDaemon, error)

func NewDaemontools

func NewDaemontools(name string, serviceUser *user.User, runDir string, command string, args ...string) (CobraDaemon, error)

func NewRCDaemon

func NewRCDaemon(name string, daemonUser *user.User, runDir string, command string, args ...string) (CobraDaemon, error)

func NewWindowsTask

func NewWindowsTask(taskName string, taskUser *user.User, taskDir string, taskCommand string, taskArgs ...string) (CobraDaemon, error)

type Daemontools

type Daemontools struct {
	Name       string
	Username   string
	Uid        string
	Gid        string
	Executable string
	Args       string
	Dir        string
	LogFile    string
	// contains filtered or unexported fields
}

func (*Daemontools) Delete

func (d *Daemontools) Delete() error

func (*Daemontools) GetConfig

func (d *Daemontools) GetConfig() (string, error)

func (*Daemontools) Install

func (d *Daemontools) Install() error

func (*Daemontools) Query

func (d *Daemontools) Query() (bool, error)

func (*Daemontools) Start

func (d *Daemontools) Start() error

func (*Daemontools) Stop

func (d *Daemontools) Stop() error

type RCDaemon

type RCDaemon struct {
	Name       string
	Username   string
	Uid        string
	Executable string
	Args       string
	Dir        string
	LogFile    string
	// contains filtered or unexported fields
}

func (*RCDaemon) Delete

func (d *RCDaemon) Delete() error

func (*RCDaemon) GetConfig

func (d *RCDaemon) GetConfig() (string, error)

func (*RCDaemon) Install

func (d *RCDaemon) Install() error

func (*RCDaemon) Query

func (d *RCDaemon) Query() (bool, error)

func (*RCDaemon) Start

func (d *RCDaemon) Start() error

func (*RCDaemon) Stop

func (d *RCDaemon) Stop() error

type WindowsTask

type WindowsTask struct {
	Name       string
	Username   string
	Uid        string
	Executable string
	Args       string
	Dir        string
	LogFile    string
}

func (*WindowsTask) Delete

func (t *WindowsTask) Delete() error

func (*WindowsTask) GetConfig

func (t *WindowsTask) GetConfig() (string, error)

func (*WindowsTask) Install

func (t *WindowsTask) Install() error

func (*WindowsTask) Query

func (t *WindowsTask) Query() (bool, error)

func (*WindowsTask) Start

func (t *WindowsTask) Start() error

func (*WindowsTask) Stop

func (t *WindowsTask) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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