apkgdb

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// from sys/personality.h
	PER_LINUX32 = 0x0008
)
View Source
const PKG_URL_PREFIX = "https://data.apkg.net/"

Variables

This section is empty.

Functions

This section is empty.

Types

type Arch

type Arch uint32
const (
	AnyArch Arch = iota
	X86
	AMD64
	ARM
	ARM64
	RiscV64
	BadArch Arch = 0xffffffff
)

func ParseArch

func ParseArch(arch string) Arch

func (Arch) String

func (arch Arch) String() string

type ArchOS

type ArchOS struct {
	OS   OS
	Arch Arch
}

func ParseArchOS

func ParseArchOS(archos string) ArchOS

func (ArchOS) IsValid

func (archos ArchOS) IsValid() bool

func (ArchOS) String

func (archos ArchOS) String() string

type DB

type DB struct {
	// contains filtered or unexported fields
}

func New

func New(prefix, name, path string) (*DB, error)

func NewOsArch

func NewOsArch(prefix, name, path, dbos, dbarch string) (*DB, error)

func (*DB) AddPackage

func (d *DB) AddPackage(rpath string, info os.FileInfo, p *Package) error

func (*DB) AddRef

func (i *DB) AddRef(count uint64) uint64

func (*DB) Close

func (d *DB) Close() error

func (*DB) CurrentVersion

func (d *DB) CurrentVersion() (v string)

func (*DB) DelRef

func (i *DB) DelRef(count uint64) uint64

func (*DB) ExportAndUpload

func (d *DB) ExportAndUpload(k hsm.Key) error

func (*DB) FillAttr

func (i *DB) FillAttr(attr *fuse.Attr) error

func (*DB) GetInode

func (d *DB) GetInode(reqino uint64) (apkgfs.Inode, error)

func (*DB) Inodes

func (d *DB) Inodes() uint64

func (*DB) IsDir

func (i *DB) IsDir() bool

func (*DB) Length

func (d *DB) Length() (sz uint64)

func (*DB) ListSubs

func (d *DB) ListSubs() []ArchOS

func (*DB) Lookup

func (i *DB) Lookup(ctx context.Context, name string) (n uint64, err error)

func (*DB) Mode

func (i *DB) Mode() os.FileMode

func (*DB) Open

func (i *DB) Open(flags uint32) (uint32, error)

func (*DB) OpenDir

func (i *DB) OpenDir() (uint32, error)

func (*DB) PackagesSize

func (d *DB) PackagesSize() uint64

func (*DB) ReadDir

func (d *DB) ReadDir(input *fuse.ReadIn, out *fuse.DirEntryList, plus bool) error
func (i *DB) Readlink() ([]byte, error)

func (*DB) RemovePackage

func (d *DB) RemovePackage(name string) error

func (*DB) ServeHTTP

func (d *DB) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*DB) SetNotifyTarget added in v0.2.3

func (db *DB) SetNotifyTarget(tgt NotifyTarget)

func (*DB) StatFs

func (i *DB) StatFs(out *fuse.StatfsOut) error

func (*DB) SubGet

func (d *DB) SubGet(sub ArchOS) (*DB, error)

func (*DB) Update

func (d *DB) Update()

type NotifyTarget added in v0.2.3

type NotifyTarget interface {
	NotifyInode(ino uint64, offt int64, data []byte) error
}

type OS

type OS uint32
const (
	AnyOS OS = iota
	Linux
	Darwin
	Windows
	BadOS OS = 0xffffffff
)

func ParseOS

func ParseOS(os string) OS

func (OS) String

func (os OS) String() string

type Package

type Package struct {
	// contains filtered or unexported fields
}

func OpenPackage

func OpenPackage(f *os.File) (*Package, error)

func (*Package) Less

func (p *Package) Less(than llrb.Item) bool

func (*Package) Meta

func (p *Package) Meta(v interface{}) error

func (*Package) ReadAt

func (p *Package) ReadAt(b []byte, off int64) (int, error)

func (*Package) Value

func (p *Package) Value() uint64

type PackageMeta

type PackageMeta struct {
	BaseName  string                       `json:"base_name"`
	FullName  string                       `json:"full_name"`
	Name      string                       `json:"name"`            // x11-libs.libdrm.libs
	Names     []string                     `json:"names,omitempty"` // name + version
	Version   string                       `json:"version"`         // 2.4.115
	Arch      string                       `json:"arch"`
	OS        string                       `json:"os"`
	BlockSize int64                        `json:"block_size"`
	Blocks    int                          `json:"blocks"`
	Category  string                       `json:"category"`
	Subcat    string                       `json:"subcat"`
	Hash      string                       `json:"hash"`
	Inodes    uint32                       `json:"inodes"`
	LDSO      []byte                       `json:"ld.so.cache,omitempty"` // optional ld.so.cache file, as base64
	Provides  map[string]*PackageMetaFile  `json:"provides"`
	Size      int64                        `json:"size"`
	Virtual   map[string]map[string]string `json:"virtual,omitempty"`
	Created   []int64                      `json:"created"`
}

type PackageMetaFile

type PackageMetaFile struct {
	Mode    fs.FileMode `json:"mode,omitempty"`
	Size    int64       `json:"size,omitempty"`
	Symlink string      `json:"symlink,omitempty"`
}

Jump to

Keyboard shortcuts

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