Documentation
¶
Overview ¶
Package control lets one vrok process inspect and manage the shares of another.
Shares live in the memory of the process that created them, which is what makes them disappear when that process exits. `vrok list` and `vrok revoke` therefore cannot read a database — there is none — so instead every sharing process exposes a small API on a Unix socket in the user's own state directory, and the management commands talk to those sockets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoSessions = errors.New("control: no active vrok sessions")
ErrNoSessions reports that no vrok process is currently sharing.
Functions ¶
func StateDir ¶
StateDir returns the directory holding session sockets. XDG_STATE_HOME wins on every platform, so the location can be overridden and tested anywhere; otherwise each platform's own convention applies.
It is created with owner-only permissions: anything in it can stop another process's shares.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to one vrok session.
type Provider ¶
type Provider interface {
Shares() []ShareInfo
// Revoke stops one share, reporting whether it existed.
Revoke(id string) bool
// Stop shuts the whole process down.
Stop()
}
Provider is the sharing process's side of the control API. The CLI implements it over its own registry.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server exposes one process's shares on a Unix socket.