daemon

package
v0.0.0-...-fe84549 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: GPL-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	/*
	 * Fscache ensures that the maximum length of cookie key is 255. The volume key
	 * is controlled by netfs, and generally no bigger than 255.
	 */
	CACHEFILES_MSG_MAX_SIZE = 1024

	CACHEFILES_OP_OPEN  = 0
	CACHEFILES_OP_CLOSE = 1
	CACHEFILES_OP_READ  = 2

	CACHEFILES_IOC_READ_COMPLETE = _IOC_WRITE<<_IOC_DIRSHIFT | 0x98<<_IOC_TYPESHIFT | 1<<_IOC_NRSHIFT | 4<<_IOC_SIZESHIFT
)

Variables

View Source
var (
	// protocol is json over http over unix socket
	// socket is path.Join(CachePath, Socket)
	// accessible to root only!
	Socket       = "styx.sock"
	InitPath     = "/init"
	MountPath    = "/mount"
	UmountPath   = "/umount"
	PrefetchPath = "/prefetch"
	GcPath       = "/gc"
	DebugPath    = "/debug"
	RepairPath   = "/repair"
)

Functions

func CachefilesServer

func CachefilesServer(cfg Config) *server

Types

type Config

type Config struct {
	DevPath     string
	CachePath   string
	CacheTag    string
	CacheDomain string

	ErofsBlockShift int

	Workers         int
	ReadaheadChunks int

	IsTesting bool
}

type DebugChunkInfo

type DebugChunkInfo struct {
	Slab       uint16
	Addr       uint32
	StorePaths []string
	Present    bool
}

type DebugImage

type DebugImage struct {
	Image    *pb.DbImage
	Manifest *pb.Manifest
	Stats    DebugSizeStats
}

type DebugReq

type DebugReq struct {
	IncludeAllImages bool     `json:",omitempty"`
	IncludeImages    []string `json:",omitempty"` // list of base32 sph

	IncludeSlabs  bool `json:",omitempty"`
	IncludeChunks bool `json:",omitempty"`
}

type DebugResp

type DebugResp struct {
	Params  *pb.DbParams
	Stats   Stats
	DbStats bbolt.Stats
	Images  map[string]DebugImage      `json:",omitempty"`
	Slabs   []*DebugSlabInfo           `json:",omitempty"`
	Chunks  map[string]*DebugChunkInfo `json:",omitempty"`
}

type DebugSizeStats

type DebugSizeStats struct {
	TotalChunks   int
	TotalBlocks   int
	PresentChunks int
	PresentBlocks int
}

type DebugSlabInfo

type DebugSlabInfo struct {
	Index         uint16
	Stats         DebugSizeStats
	ChunkSizeDist map[uint32]int
}

type GcReq

type GcReq struct {
}

type InitReq

type InitReq struct {
	PubKeys []string
	Params  pb.DaemonParams
}

type MountReq

type MountReq struct {
	Upstream   string
	StorePath  string
	MountPoint string
	NarSize    int64 `json:",omitempty"` // optional
}

type PrefetchReq

type PrefetchReq struct {
	Path string
}

type RepairReq

type RepairReq struct {
	Presence bool `json:",omitempty"`
}

type Sph

func SphFromBytes

func SphFromBytes(b []byte) (sph Sph)

func (Sph) String

func (s Sph) String() string

type SphPrefix

type SphPrefix [sphPrefixBytes]byte

func SphPrefixFromBytes

func SphPrefixFromBytes(b []byte) (sphp SphPrefix)

type Stats

type Stats struct {
	ManifestCacheReqs int64 // total manifest cache requests
	ManifestCacheHits int64 // requests that got a hit
	ManifestReqs      int64 // requests for new manifest
	ManifestErrs      int64 // requests for new manifest that got an error
	SlabReads         int64 // read requests to slab
	SlabReadErrs      int64 // failed read requests to slab
	SingleReqs        int64 // chunk request count
	SingleBytes       int64 // chunk bytes received (uncompressed)
	SingleErrs        int64 // chunk request error count
	BatchReqs         int64 // no-base diff request count
	BatchBytes        int64 // no-base diff bytes received (compressed)
	BatchErrs         int64 // no-base diff request error count
	DiffReqs          int64 // with-base diff request count
	DiffBytes         int64 // with-base diff bytes received (compressed)
	DiffErrs          int64 // with-base diff request error count
	RecompressReqs    int64 // reqs with recompression
}

type Status

type Status struct {
	Success bool   `json:",omitempty"`
	Error   string `json:",omitempty"`
}

type UmountReq

type UmountReq struct {
	StorePath string
}

Jump to

Keyboard shortcuts

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