The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
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.
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.
type Provider interface {
// Shares returns the live shares of this process. 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.
Start creates the socket and begins serving. A failure here is not fatal to
sharing itself — the share still works, only `vrok list` cannot see it — so
callers are expected to warn rather than abort.
type ShareInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
Source string `json:"source"`
URL string `json:"url"`
CreatedAt time.Time `json:"created_at"`
// ExpiresAt is zero for a share with no TTL. ExpiresAt time.Time `json:"expires_at"`
Downloads int `json:"downloads"`
MaxDownloads int `json:"max_downloads"`
Bytes int64 `json:"bytes"`
LastAccess time.Time `json:"last_access"`
Protected bool `json:"protected"`
Tunnel string `json:"tunnel"`
// PID identifies the process serving this share, filled in by the client. PID int `json:"pid,omitempty"`
}
ShareInfo is a share as seen from another process.