Help us shape the future of Go! Take the 2026 Go Developer Survey

services

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcessState

type ProcessState int
const (
	Unknown  ProcessState = iota
	NotFound ProcessState = iota
	Running
	InterruptibleSleep
	UninterruptibleSleep
	Stopped
	Zombie
	Dead
	TracingStop
	Idle
	Parked
	Waking
)

func (ProcessState) String

func (ps ProcessState) String() string

type ServiceEvent

type ServiceEvent struct {
	Unique string
	Event  string
}

type SingleTracker

type SingleTracker struct {
	Tracked Tracked

	sync.RWMutex
	// contains filtered or unexported fields
}

func (*SingleTracker) Stop

func (t *SingleTracker) Stop()

type Tracked

type Tracked interface {
	Name() string   // For display
	Unique() string // For identification in the system
	GetStatus() (ProcessState, error)
	GetUsage() (*Usage, error)
	Kill() error
}

func NewTracked

func NewTracked(service *configurations.Service, tracker *runtimev1.Tracker) (Tracked, error)

type TrackedContainer

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

func (TrackedContainer) GetStatus

func (t TrackedContainer) GetStatus() (ProcessState, error)

func (TrackedContainer) GetUsage

func (t TrackedContainer) GetUsage() (*Usage, error)

func (TrackedContainer) Kill

func (t TrackedContainer) Kill() error

func (TrackedContainer) Name

func (t TrackedContainer) Name() string

func (TrackedContainer) Unique

func (t TrackedContainer) Unique() string

type TrackedProcess

type TrackedProcess struct {
	PID    int
	Killed bool
	// contains filtered or unexported fields
}

func (*TrackedProcess) GetStatus

func (p *TrackedProcess) GetStatus() (ProcessState, error)

func (*TrackedProcess) GetUsage

func (p *TrackedProcess) GetUsage() (*Usage, error)

func (*TrackedProcess) Kill

func (p *TrackedProcess) Kill() error

func (*TrackedProcess) Name

func (p *TrackedProcess) Name() string

func (*TrackedProcess) Proto

func (p *TrackedProcess) Proto() *runtimev1.Tracker

func (*TrackedProcess) Unique

func (p *TrackedProcess) Unique() string

type Tracker

type Tracker interface {
	Start(events chan<- ServiceEvent) error
	Stop()
}

type Usage

type Usage struct {
	Memory float64 // In KB
	CPU    float64
}

Jump to

Keyboard shortcuts

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