Documentation
¶
Index ¶
Constants ¶
View Source
const ( ManifestBitmapDeflate = 0x00001000 ManifestBitmapBzip2 = 0x00002000 EntryPermMask = 0x000001FF EntryPermMask_usr = 0x000001C0 EntryPermShift_usr = 6 EntryPermMask_grp = 0x00000038 EntryPermShift_grp = 3 EntryPermMask_oth = 0x00000007 EntryPermDef_file = 0x000001B6 EntryPermDef_dir = 0x000001FF CompressionMask = 0xF000 EntryCompressedNone = 0x00000000 EntryCompressedGzip = 0x00001000 EntryCompressedBzip2 = 0x00002000 )
View Source
const ( SignatureMD5 = SignatureFlag(0x0001) SignatureSHA1 = SignatureFlag(0x0002) SignatureSHA256 = SignatureFlag(0x0003) SignatureSHA512 = SignatureFlag(0x0004) SignatureOpenSSL = SignatureFlag(0x0010) SignatureOpenSSLSha256 = SignatureFlag(0x0011) SignatureOpenSSLSha512 = SignatureFlag(0x0012) )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
Filename string
Timestamp time.Time
Size int64
Flags uint32
SizeUncompressed int64
SizeCompressed int64
CRC uint32
MetaSerialized []byte
// contains filtered or unexported fields
}
func ParseEntryManifest ¶
Parse file entry manifest to struct
PHP Docs: https://www.php.net/manual/en/phar.fileformat.manifestfile.php
type Manifest ¶
type Manifest struct {
Length uint32
EntitiesCount uint32
Version string
Flags uint32
Alias []byte
AliasLength uint32
Metadata []byte
IsSigned bool
}
func ParseManifest ¶
Parse phar menifest
PHP Docs: https://www.php.net/manual/en/phar.fileformat.phar.php
type Signature ¶
type Signature struct {
Signature SignatureFlag
Hash []byte
}
func GetSignature ¶
Get phar signature
PHP Docs: https://www.php.net/manual/en/phar.fileformat.signature.php
Important Golang not support have in std openssl module, and return ErrOpenssl if presence of openssl signature
type SignatureFlag ¶
type SignatureFlag uint32
func (SignatureFlag) MarshalText ¶
func (sig SignatureFlag) MarshalText() (text []byte, err error)
func (SignatureFlag) String ¶
func (sig SignatureFlag) String() string
Click to show internal directories.
Click to hide internal directories.