lib

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: GPL-3.0, LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConstGenerateRepositoryEPKMagicNumber = []byte{0x65, 0x6F, 0x6E}

ConstGenerateRepositoryEPKMagicNumber is the magic number for an EPK repository: "eon" in ASCII / UTF-8, for obvious reasons

View Source
var ConstGenerateRepositoryRepoDataOffset int64 = 99

ConstGenerateRepositoryRepoDataOffset is the offset of the repository data in the repository.json file: it is 3 (magic) + 64 (the signature) + 32 (the public key) = 99

View Source
var ConstPackageEPKBigEndian = []byte{0x62}

ConstPackageEPKBigEndian is the letter "b" in ASCII / UTF-8

View Source
var ConstPackageEPKInitialByteOffset int64 = 12

ConstPackageEPKInitialByteOffset is the initial byte offset for an EPK file until we arrive at the signature. 12 = 3 + 1 + 8: 3 for the magic number, 1 for the endian, and 8 for the tar offset

View Source
var ConstPackageEPKLittleEndian = []byte{0x6C}

ConstPackageEPKLittleEndian is the letter "l" in ASCII / UTF-8

View Source
var ConstPackageEPKMagicNumber = []byte{0x65, 0x70, 0x6B}

ConstPackageEPKMagicNumber is the magic number for an EPK file: "epk" in ASCII / UTF-8

View Source
var ConstPackageEPKMetadataOffset = 108

ConstPackageEPKMetadataOffset is the offset of the metadata in the EPK file

View Source
var ConstPackageEPKPublicKeyLength int64 = 32

ConstPackageEPKPublicKeyLength is the length of the public key

View Source
var ConstPackageEPKSignatureLength int64 = 64

ConstPackageEPKSignatureLength is the length of the signature

View Source
var ErrBuildEPKBadBuildType = errors.New("bad build type")
View Source
var ErrBuildEPKBuildShError = errors.New("error creating build.sh")
View Source
var ErrBuildEPKChrootError = errors.New("chroot builds are not supported yet")
View Source
var ErrBuildEPKCopyHooksError = errors.New("error copying hooks")
View Source
var ErrBuildEPKCountingFilesError = errors.New("error counting files")
View Source
var ErrBuildEPKCreateHooksError = errors.New("error creating hooks directory")
View Source
var ErrBuildEPKExecutingBuildShError = errors.New("error executing build.sh")
View Source
var ErrBuildEPKTargetRootError = errors.New("error creating target root")
View Source
var ErrBuildEPKTemporaryDirectoryError = errors.New("error creating temporary directory")
View Source
var ErrBuildEPKUnrestrictedError = errors.New("unrestricted builds are not supported yet")
View Source
var ErrBuildEPKWritingBuildShError = errors.New("error writing to build.sh")
View Source
var ErrEternityJsonMapError = errors.New("error mapping eternity.json")
View Source
var ErrEternityJsonOpenError = errors.New("error opening eternity.json")
View Source
var ErrEternityJsonParseError = errors.New("error parsing eternity.json")
View Source
var ErrEternityJsonReadError = errors.New("error reading eternity.json")
View Source
var ErrGenerateRepositoryCannotCloseFile = errors.New("error closing file")
View Source
var ErrGenerateRepositoryCannotMarshalJSON = errors.New("error marshalling JSON")
View Source
var ErrGenerateRepositoryCannotOpenFile = errors.New("error opening file for writing")
View Source
var ErrGenerateRepositoryCannotUnmarshalJSON = errors.New("error unmarshalling JSON")
View Source
var ErrGenerateRepositoryCannotWriteFile = errors.New("error writing to file")
View Source
var ErrGenerateRepositoryFailedToWalk = errors.New("error walking directory")
View Source
var ErrGenerateRepositoryNotDirectory = errors.New("not a directory")
View Source
var ErrGenerateRepositoryRepositoryNameContainsSlash = errors.New("repository name contains a slash")
View Source
var ErrGenerateRepositoryStatError = errors.New("error stating file or directory")
View Source
var ErrPackageEPKCannotCloseFile = errors.New("error closing EPK file")
View Source
var ErrPackageEPKCannotOpenFile = errors.New("error opening EPK file for writing")
View Source
var ErrPackageEPKCannotWriteFile = errors.New("error writing to EPK file")
View Source
var ErrPackageEPKCompressCloseError = errors.New("error closing EPK ZStandard writer")
View Source
var ErrPackageEPKCreateCompressionWriterError = errors.New("error creating ZStandard writer")
View Source
var ErrPackageEPKCreateDistDirError = errors.New("error creating dist directory")
View Source
var ErrPackageEPKFailedToSeek = errors.New("error seeking in EPK file")
View Source
var ErrPackageEPKFailedToWriteHash = errors.New("error writing hash to EPK file")
View Source
var ErrPackageEPKJSONMarshal = errors.New("error marshalling JSON")
View Source
var ErrPackageEPKMoveToDistError = errors.New("error moving to dist directory")
View Source
var ErrPackageEPKTarError = errors.New("error creating tar")

Functions

func BuildEPK

func BuildEPK(projectDir string, inMemory bool, buildConfig Build, logger *Logger) (big.Int, string, error, error)

BuildEPK builds the EPK package into a build directory

func CreateTar

func CreateTar(targetDir string, output io.Writer) error

CreateTar creates a tar archive from a directory

func GenerateRepository

func GenerateRepository(directory string, privateKey ed25519.PrivateKey, logger *Logger) (error, error)

func PackageEPK

func PackageEPK(metaData Metadata, build Build, tempDir string, output string, privateKey ed25519.PrivateKey, logger *Logger) (error, error)

PackageEPK packages the EPK work directory into an EPK file

Types

type Build

type Build struct {
	Type         string
	Dependencies []string
	Steps        []string
	TargetRoot   string
	HooksFolder  PotentiallyNullString
	FilesFolder  PotentiallyNullString
}

Build is a struct that contains the build configuration of the package

type Config

type Config struct {
	Metadata Metadata
	Build    Build
}

Config is a struct that contains the configuration of the package

func ParseConfig

func ParseConfig(path string, logger *Logger) (Config, error, error)

ParseConfig parses the eternity.json file

type Log

type Log struct {
	Level   string
	Content string
	Prompt  bool
}

Log is a struct that contains the log information

type Logger

type Logger struct {
	LogFunc         func(Log) string
	PromptSupported bool
	StdoutSupported bool
	Stdout          io.Writer
}

Logger is a struct that contains the functions and properties of the logger

type Metadata

type Metadata struct {
	Name            string
	Description     string
	LongDescription string
	Version         semver.Version
	Author          string
	License         string
	Architecture    string
	// The decompressed size may be larger than the int64 allocated for a compressed file
	DecompressedSize big.Int
	Dependencies     []string
	SpecialFiles     SpecialFiles
}

Metadata is a struct that contains the metadata of the package

type PotentiallyNullString

type PotentiallyNullString struct {
	Value string
	Null  bool
}

PotentiallyNullString is a struct that contains a string that may be null

type SpecialFiles

type SpecialFiles struct {
	NoDelete  []string
	NoReplace []string
}

SpecialFiles is a struct that contains the special files that are not to be deleted or replaced

Jump to

Keyboard shortcuts

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