Documentation
¶
Overview ¶
Package worker runs chunk codecs in an independently updatable process. The versioned HTTP protocol carries binary chunk bodies over a Unix socket.
Index ¶
Constants ¶
const DefaultMaxChunkBytes int64 = 64 << 20
const ProtocolVersion = 1
Variables ¶
var BuildVersion = "dev"
BuildVersion may be set independently of the mount binary with -ldflags -X.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type DeviceLock ¶
type DeviceLock struct {
// contains filtered or unexported fields
}
DeviceLock gives cooperating workers of the same Unix user one owner for a card's user BAR. Multiple mounts should share that owner's worker socket. Linux releases the advisory lock even when its owner is killed.
func (*DeviceLock) Acquire ¶
func (l *DeviceLock) Acquire(device string) error
func (*DeviceLock) Close ¶
func (l *DeviceLock) Close() error
type Info ¶
type Info struct {
Protocol int `json:"protocol"`
Version string `json:"version"`
PID int `json:"pid"`
Codecs []string `json:"codecs"`
MaxChunkBytes int64 `json:"max_chunk_bytes"`
Concurrency int `json:"concurrency"`
Prediction *codec.PredictionOptions `json:"prediction,omitempty"`
FileEncoding bool `json:"file_encoding"`
FileResults bool `json:"file_results"`
FileDecoding bool `json:"file_decoding"`
}
type Process ¶
type Process struct {
Socket string
// contains filtered or unexported fields
}
Process supervises a worker at a private socket. Re-exec always resolves the configured path again, so an atomically replaced binary is picked up after the old worker exits. It never owns backend data or namespace metadata.
func StartProcess ¶
func StartProcess(options ProcessOptions) (*Process, error)
type ProcessOptions ¶
type ProcessOptions struct {
// Binary implements the "worker" subcommand. Empty uses this executable.
Binary string
Args []string
Log io.Writer
// Config is private TOML configuration for the worker. Older workers can
// ignore new keys while continuing to accept the existing --config flag.
Config []byte
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(options ServerOptions) (*Server, error)