ipc

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const IdleTimeout = 60 * time.Second

IdleTimeout bounds how long either side waits on a quiet connection

Variables

View Source
var ErrElevate = errors.New("granting permissions")

Functions

func ClearLog

func ClearLog(path string) error

func Configuration

func Configuration(dir string) string

func DaemonLog

func DaemonLog(dir string) string

func Dir

func Dir() (string, error)

func EngineLog

func EngineLog(dir string) string

func EnsureDir

func EnsureDir(dir string) error

func Socket

func Socket(dir string) string

func Subscriptions

func Subscriptions(dir string) string

func TUILog added in v1.4.8

func TUILog(dir string) string

Types

type Args

type Args struct {
	ID       string
	Sub      string
	URL      string
	Dir      int
	Tun      bool
	Settings domain.Settings
}

type Client

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

func NewClient

func NewClient(socket string) *Client

func (*Client) AddSub

func (c *Client) AddSub(url string) (Sub, error)

func (*Client) Connect

func (c *Client) Connect(ref domain.NodeRef) error

func (*Client) Disconnect

func (c *Client) Disconnect() error

func (*Client) MoveSub

func (c *Client) MoveSub(id string, dir int) error

func (*Client) Ping

func (c *Client) Ping() error

func (*Client) Probe

func (c *Client) Probe(sub, id string) error

func (*Client) Refresh

func (c *Client) Refresh(id string) error

func (*Client) RefreshAll

func (c *Client) RefreshAll() error

func (*Client) RemoveSub

func (c *Client) RemoveSub(id string) error

func (*Client) SetSettings

func (c *Client) SetSettings(s domain.Settings) error

func (*Client) SetTun

func (c *Client) SetTun(enable bool) error

func (*Client) Shutdown

func (c *Client) Shutdown() error

func (*Client) Snapshot

func (c *Client) Snapshot() (Snapshot, error)

func (*Client) Watch

func (c *Client) Watch(ctx context.Context, onUpdate func(Snapshot)) error

type Node

type Node struct {
	ID       string
	Name     string
	Protocol string
	Server   string
	Port     int
	Sub      string

	// false until Probe has run
	Probed  bool
	Alive   bool
	MS      int
	Probing bool
}

func (Node) Ref

func (n Node) Ref() domain.NodeRef

type Req

type Req struct {
	Method string
	Args   Args
}

type Resp

type Resp struct {
	OK     bool
	Result json.RawMessage
	Error  string
}

type Snapshot

type Snapshot struct {
	Revision      uint64
	Settings      domain.Settings
	Subscriptions []Sub
	Nodes         []Node
	Status        Status
	Active        domain.NodeRef
}

type Status

type Status struct {
	Connected bool
	NodeRef   domain.NodeRef
	NodeName  string
	StartedAt time.Time
	Port      int
	Tun       bool
}

func (Status) Uptime

func (s Status) Uptime() time.Duration

type Sub

type Sub struct {
	ID         string
	Name       string
	Nodes      int
	UpdatedAt  time.Time
	Traffic    domain.Traffic
	Direct     bool // a bare share link
	Refreshing bool
}

Jump to

Keyboard shortcuts

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