Packmatic.Manifest.Entry (Packmatic v2.0.0)

View Source

Represents a particular file that will go into package, which is sourced by reading from a file, downloading from an URI, etc.

The source attribute is a Source Entry (Packmatic.Source.entry/0), which will be dynamically resolved at runtime using Packmatic.Source.build/1 by the Encoder, when it is time to start reading from it.

The path attribute is the file name in the record; by default, it should be a relative path.

The timestamp attribute is a UTC DataTime which will be presented in both the normal way (DOS timestamp) and the extended way.

The attributesattribute represents specific attributes (mode, UID, GID, etc) of the record; the permissions of any file whose Entry does not have a specific attribute will be 0o644 (octal), aka rw-r--r-- (owner read/write, others read only). For more information please see the type Packmatic.Manifest.Entry.Attributes.entry/0.

The method attribute represents how a particular file should be compressed by the Encoder, and are represented as name or {name, options}, for example:

  • :store

  • :deflate

  • {:deflate, level: :best_compression}, where the level is of t:zlib:zlevel/0

For compatibility reasons, only STORE and DEFLATE methods are supported initially; further compression methods such as Zstandard can be added in the future, but they must remain representable within the General Purpose bits within the File Headers.

Summary

Types

attributes()

error()

@type error() :: error_source() | error_path() | error_timestamp()

error_path()

@type error_path() :: {:path, :missing}

error_source()

@type error_source() :: {:source, :missing | :invalid}

error_timestamp()

@type error_timestamp() :: {:timestamp, :missing | :invalid}

method()

@type method() :: :store | :deflate

path()

@type path() :: Path.t()

proplist()

@type proplist() :: [
  {:source, source()}
  | {:path, path()}
  | {:timestamp, timestamp()}
  | {:attributes, attributes()}
  | {:method, method()},
  ...
]

source()

@type source() :: Packmatic.Source.entry()

t()

@type t() :: %Packmatic.Manifest.Entry{
  attributes: term(),
  method: term(),
  path: path(),
  source: source(),
  timestamp: timestamp()
}

timestamp()

@type timestamp() :: DateTime.t()