daemon

package
v0.0.0-...-fee78ac Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDaemonCmd

func NewDaemonCmd() *cobra.Command

Types

type Daemon

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

func (*Daemon) GetServerStatus

func (d *Daemon) GetServerStatus() ServerStatus

func (*Daemon) GetStatus

func (d *Daemon) GetStatus(c *gin.Context)

GetStatus returns the status of the daemon. The relative route is /api/v1/status.

func (*Daemon) IsReady

func (d *Daemon) IsReady() bool

func (*Daemon) ListenSignal

func (d *Daemon) ListenSignal()

func (*Daemon) Start

func (d *Daemon) Start() (err error)

type DaemonStatus

type DaemonStatus struct {
	State        int32        `json:"state"`
	Ready        bool         `json:"ready"`
	Version      string       `json:"version"`
	Pid          int          `json:"pid"`
	Socket       string       `json:"socket"`
	ServerStatus ServerStatus `json:"server"`
	StartAt      int64        `json:"startAt"`
}

type Server

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

func (*Server) GetPid

func (s *Server) GetPid() int

func (*Server) GetRealState

func (s *Server) GetRealState() int32

func (*Server) GetStatus

func (s *Server) GetStatus() (res ServerStatus)

GetStatus get status of obshell server via unix socket

func (*Server) IsProcRunning

func (s *Server) IsProcRunning() bool

func (*Server) IsRunning

func (s *Server) IsRunning() bool

func (*Server) Start

func (s *Server) Start() (err error)

func (*Server) Stop

func (s *Server) Stop() (err error)

type ServerConfig

type ServerConfig struct {
	MinLiveTime    time.Duration
	QuickExitLimit int
}

type ServerStatus

type ServerStatus struct {
	Status http.AgentStatus
	Socket string `json:"socket"`
	EndAt  int64  `json:"endAt"`
}

Jump to

Keyboard shortcuts

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