Documentation ¶
Overview ¶
Package backend provides a zbstore implementation backed by local compute resources.
Index ¶
Constants ¶
const DefaultBuildUsersGroup = "zbld"
DefaultBuildUsersGroup is the conventional name of the Unix group for the users that execute builders on behalf of the daemon.
Variables ¶
This section is empty.
Functions ¶
func CanSandbox ¶
func CanSandbox() bool
CanSandbox reports whether the current execution environment supports sandboxing.
func SystemSupportsSandbox ¶
func SystemSupportsSandbox() bool
SystemSupportsSandbox reports whether the host operating system supports sandboxing.
Types ¶
type BuildUser ¶
type BuildUser struct { // UID is the user ID. UID int // GID is the user's primary group ID. GID int }
BuildUser is a descriptor for a Unix user.
type NARReceiver ¶
type NARReceiver struct {
// contains filtered or unexported fields
}
NARReceiver is a per-connection zbstore.NARReceiver.
func (*NARReceiver) Cleanup ¶
func (r *NARReceiver) Cleanup(ctx context.Context)
Cleanup releases any resources associated with the receiver.
func (*NARReceiver) ReceiveNAR ¶
func (r *NARReceiver) ReceiveNAR(trailer *zbstore.ExportTrailer)
type Options ¶
type Options struct { // RealDir is where the store objects are located physically on disk. // If empty, defaults to the store directory. RealDir string // BuildDir is where realizations' working directories will be placed. // If empty, defaults to [os.TempDir]. BuildDir string // If DisableSandbox is true, then builders are always run without the sandbox. // Otherwise, sandboxing is used whenever possible. DisableSandbox bool // SandboxPaths is a map of paths inside the sandbox // to paths on the host machine. // These paths will be made available to sandboxed builders. SandboxPaths map[string]string // BuildUsers is the set of user IDs to use for builds on non-Windows systems. // If empty, then builds will use the current process's privileges. // [NewServer] will panic if multiple entries have the same user ID. BuildUsers []BuildUser }
Options is the set of optional parameters to NewServer.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a local store. Server implements jsonrpc.Handler and is intended to be used with jsonrpc.Serve.
func NewServer ¶
NewServer returns a new Server for the given store directory and database path. Callers are responsible for calling Server.Close on the returned server.
func (*Server) JSONRPC ¶
JSONRPC implements the jsonrpc.Handler interface and serves the zbstore API.
func (*Server) NewNARReceiver ¶
func (s *Server) NewNARReceiver(ctx context.Context) *NARReceiver
NewNARReceiver returns a new NARReceiver that is attached to the server. Callers are responsible for calling NARReceiver.Cleanup after the receiver is no longer in use.