systray

package
v0.0.0-...-f174eeb Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFile = "systray-config.json"

Variables

This section is empty.

Functions

func AddMenuItem

func AddMenuItem(title string, tooltip string) *cachedMenuItem

func AddMenuItemCheckbox

func AddMenuItemCheckbox(title string, tooltip string, checked bool) *cachedMenuItem

func Spawn

func Spawn(ctx context.Context, log *logrus.Entry, cfg Config, notifier notify.Notifier)

Types

type Config

type Config struct {
	GrpcAddress string

	ConfigDir string

	LogLevel    string
	LogFilePath string

	BlackAndWhiteIcons bool
	Notifier           notify.Notifier
}

func (*Config) Persist

func (cfg *Config) Persist() error

func (*Config) Populate

func (cfg *Config) Populate() error

type GatewayItem

type GatewayItem struct {
	Gateway  *pb.Gateway
	MenuItem *cachedMenuItem
}

type Gui

type Gui struct {
	DeviceAgentClient        pb.DeviceAgentClient
	AgentStatusChannel       chan *pb.AgentStatus
	AgentStatus              *pb.AgentStatus
	Events                   chan GuiEvent
	Interrupts               chan os.Signal
	NewVersionAvailable      chan bool
	PrivilegedGatewayClicked chan string
	TenantItemClicked        chan string
	ProgramContext           context.Context
	MenuItems                struct {
		Connect       *cachedMenuItem
		Quit          *cachedMenuItem
		State         *cachedMenuItem
		StateInfo     *cachedMenuItem
		Logs          *cachedMenuItem
		Settings      *cachedMenuItem
		AutoConnect   *cachedMenuItem
		BlackAndWhite *cachedMenuItem
		DeviceLog     *cachedMenuItem
		HelperLog     *cachedMenuItem
		SystrayLog    *cachedMenuItem
		ZipLog        *cachedMenuItem
		Version       *cachedMenuItem
		Upgrade       *cachedMenuItem
		Tenant        *cachedMenuItem
		TenantItems   []*TenantItem
		GatewayItems  []*GatewayItem
		AcceptableUse *cachedMenuItem
	}
	Config Config
	// contains filtered or unexported fields
}

func NewGUI

func NewGUI(ctx context.Context, log *logrus.Entry, client pb.DeviceAgentClient, cfg Config, notifier notify.Notifier) *Gui

func (*Gui) EventLoop

func (gui *Gui) EventLoop(ctx context.Context)

type GuiEvent

type GuiEvent int
const (
	VersionClicked GuiEvent = iota
	StateInfoClicked
	ConnectClicked
	QuitClicked
	DeviceLogClicked
	HelperLogClicked
	ZipLogsClicked
	LogClicked
	AutoConnectClicked
	BlackAndWhiteClicked
	AcceptableUseClicked
)

type TenantItem

type TenantItem struct {
	Tenant   *pb.Tenant
	MenuItem *cachedMenuItem
}

Jump to

Keyboard shortcuts

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