config

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

func Save

func Save(path string, value Config) error

func Update added in v0.12.0

func Update(path string, update func(*Config) error) error

Update performs a read/modify/write transaction while holding the same sidecar lock used by Save. Endpoint selection is shared by the Desktop and CLI, so loading and saving in separate critical sections can otherwise drop a concurrent update.

Types

type Config

type Config struct {
	Current   string              `json:"current"`
	Endpoints map[string]Endpoint `json:"endpoints"`
}

func Load

func Load(path string) (Config, error)

func (Config) Names

func (c Config) Names() []string

func (Config) Resolve

func (c Config) Resolve(name string) (Endpoint, error)

type Endpoint

type Endpoint struct {
	Name      string `json:"name"`
	URL       string `json:"url"`
	Token     string `json:"token"`
	SSH       string `json:"ssh,omitempty"`
	SSHRemote string `json:"sshRemote,omitempty"`
	Type      string `json:"type,omitempty"`
	HostID    string `json:"host_id,omitempty"`
	RouteID   string `json:"route_id,omitempty"`
}

Jump to

Keyboard shortcuts

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