api

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	suture.Service
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(l *slog.Logger, address string, apiKey string) *API

func (*API) Address

func (s *API) Address() string

func (*API) Events

func (s *API) Events(types []events.EventType) *EventSource

func (*API) GetConfig

func (s *API) GetConfig() (*stconfig.Configuration, error)

func (*API) GetDeviceStats

func (s *API) GetDeviceStats() (map[protocol.DeviceID]DeviceStatistics, error)

func (*API) GetSystemStatus

func (s *API) GetSystemStatus() (*SystemStatus, error)

func (*API) GetSystemVersion

func (s *API) GetSystemVersion() (*SystemVersion, error)

func (*API) RemoveDevice

func (s *API) RemoveDevice(deviceID protocol.DeviceID) error

func (*API) RemoveFolder

func (s *API) RemoveFolder(folderID string) error

func (*API) SetDevice

func (s *API) SetDevice(cfg *stconfig.DeviceConfiguration) error

func (*API) SetFolder

func (s *API) SetFolder(cfg *stconfig.FolderConfiguration) error

func (*API) String

func (s *API) String() string

type DeviceStatistics

type DeviceStatistics struct {
	LastSeen               time.Time
	LastConnectionDuration float64 // seconds
}

type EventSource

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

func (*EventSource) Events

func (s *EventSource) Events(ctx context.Context) ([]events.Event, error)

type SystemStatus

type SystemStatus struct {
	MyID protocol.DeviceID `json:"myID"`
}

type SystemVersion

type SystemVersion struct {
	Version string
	OS      string
	Arch    string
}

Jump to

Keyboard shortcuts

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