service

package
v0.0.0-...-143e6d5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestStart    = RequestStartService
	RequestStop     = RequestStopService
	RequestRestart  = RequestRestartService
	RequestStatus   = RequestGetStatus
	RequestList     = RequestListServices
	RequestPoweroff = RequestSystemPoweroff
	RequestReboot   = RequestSystemReboot
)
View Source
const (
	ServiceName        = "dev.avyos.service"
	ServiceID   uint32 = 80
)
View Source
const (
	RequestStartService   uint16 = 0x0110
	RequestStopService    uint16 = 0x0111
	RequestRestartService uint16 = 0x0112
	RequestGetStatus      uint16 = 0x0113
	RequestListServices   uint16 = 0x0114
	RequestSystemPoweroff uint16 = 0x0115
	RequestSystemReboot   uint16 = 0x0116
)

Variables

This section is empty.

Functions

func DecodeServiceName

func DecodeServiceName(data []byte) (string, error)

func EncodeServiceName

func EncodeServiceName(name string) []byte

func EncodeServiceStatusList

func EncodeServiceStatusList(items []ServiceStatus) []byte

Types

type Client

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

func Connect

func Connect() (*Client, error)

func NewClient

func NewClient(socketPath string) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) GetStatus

func (c *Client) GetStatus(req ServiceNameRequest) (ServiceStatus, error)

func (*Client) List

func (c *Client) List() ([]ServiceStatus, error)

func (*Client) ListServices

func (c *Client) ListServices(req Empty) (ServiceStatusList, error)

func (*Client) Poweroff

func (c *Client) Poweroff() error

func (*Client) Raw

func (c *Client) Raw() *sutra.Client

func (*Client) Reboot

func (c *Client) Reboot() error

func (*Client) Restart

func (c *Client) Restart(name string) error

func (*Client) RestartService

func (c *Client) RestartService(req ServiceNameRequest) (Empty, error)

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration)

func (*Client) Start

func (c *Client) Start(name string) error

func (*Client) StartService

func (c *Client) StartService(req ServiceNameRequest) (Empty, error)

func (*Client) Status

func (c *Client) Status(name string) (ServiceStatus, error)

func (*Client) Stop

func (c *Client) Stop(name string) error

func (*Client) StopService

func (c *Client) StopService(req ServiceNameRequest) (Empty, error)

func (*Client) SystemPoweroff

func (c *Client) SystemPoweroff(req Empty) (Empty, error)

func (*Client) SystemReboot

func (c *Client) SystemReboot(req Empty) (Empty, error)

type Empty

type Empty struct {
}

func (Empty) MarshalBinary

func (v Empty) MarshalBinary() []byte

func (*Empty) UnmarshalBinary

func (v *Empty) UnmarshalBinary(data []byte) error

type ServiceNameRequest

type ServiceNameRequest struct {
	Name string
}

func (ServiceNameRequest) MarshalBinary

func (v ServiceNameRequest) MarshalBinary() []byte

func (*ServiceNameRequest) UnmarshalBinary

func (v *ServiceNameRequest) UnmarshalBinary(data []byte) error

type ServiceStatus

type ServiceStatus struct {
	Name        string
	Description string
	Type        string
	Restart     string
	Running     bool
	Started     bool
	Failed      bool
	PID         int
}

func DecodeServiceStatus

func DecodeServiceStatus(data []byte) (ServiceStatus, error)

func DecodeServiceStatusList

func DecodeServiceStatusList(data []byte) ([]ServiceStatus, error)

func (ServiceStatus) Encode

func (s ServiceStatus) Encode() []byte

func (ServiceStatus) MarshalBinary

func (v ServiceStatus) MarshalBinary() []byte

func (*ServiceStatus) UnmarshalBinary

func (v *ServiceStatus) UnmarshalBinary(data []byte) error

type ServiceStatusList

type ServiceStatusList struct {
	Items []ServiceStatus
}

func (ServiceStatusList) MarshalBinary

func (v ServiceStatusList) MarshalBinary() []byte

func (*ServiceStatusList) UnmarshalBinary

func (v *ServiceStatusList) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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