ipc

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 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

Types

type Args

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

type Changed

type Changed struct{ Revision uint64 }

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) (Snapshot, error)

func (*Client) Connect

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

func (*Client) Disconnect

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

func (*Client) MoveSub

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

func (*Client) Ping

func (c *Client) Ping() error

func (*Client) Probe

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

func (*Client) Refresh

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

func (*Client) RefreshAll

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

func (*Client) RemoveSub

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

func (*Client) SetSettings

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

func (*Client) SetTun

func (c *Client) SetTun(enable bool) (Snapshot, 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(Changed)) 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
}

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
	Uptime    int64 // seconds
	Port      int
	Tun       bool
}

type Sub

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

Jump to

Keyboard shortcuts

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