client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New() *Client

func NewForUids

func NewForUids(uids ...int) *Client

NewForUids creates a Client that sends requests to a specific list of uids only.

func (*Client) FinishRefreshNotification

func (client *Client) FinishRefreshNotification(ctx context.Context, closeInfo *FinishedSnapRefreshInfo) error

FinishRefreshNotification closes notification about a snap refresh.

func (*Client) PendingRefreshNotification

func (client *Client) PendingRefreshNotification(ctx context.Context, refreshInfo *PendingSnapRefreshInfo) error

PendingRefreshNotification broadcasts information about a refresh.

func (*Client) ServicesDaemonReload

func (client *Client) ServicesDaemonReload(ctx context.Context) error

func (*Client) ServicesStart

func (client *Client) ServicesStart(ctx context.Context, services []string) (startFailures, stopFailures []ServiceFailure, err error)

func (*Client) ServicesStop

func (client *Client) ServicesStop(ctx context.Context, services []string) (stopFailures []ServiceFailure, err error)

func (*Client) SessionInfo

func (client *Client) SessionInfo(ctx context.Context) (info map[int]SessionInfo, err error)

type Error

type Error struct {
	Kind    string      `json:"kind"`
	Value   interface{} `json:"value"`
	Message string      `json:"message"`
}

func (*Error) Error

func (e *Error) Error() string

type FinishedSnapRefreshInfo

type FinishedSnapRefreshInfo struct {
	InstanceName string `json:"instance-name"`
}

FinishedSnapRefreshInfo holds information about a finished refresh provided to userd.

type PendingSnapRefreshInfo

type PendingSnapRefreshInfo struct {
	InstanceName        string        `json:"instance-name"`
	TimeRemaining       time.Duration `json:"time-remaining,omitempty"`
	BusyAppName         string        `json:"busy-app-name,omitempty"`
	BusyAppDesktopEntry string        `json:"busy-app-desktop-entry,omitempty"`
}

PendingSnapRefreshInfo holds information about pending snap refresh provided to userd.

type ServiceFailure

type ServiceFailure struct {
	Uid     int
	Service string
	Error   string
}

type SessionInfo

type SessionInfo struct {
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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