metadata

package
v0.0.0-...-2b7ea9d Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: CC-BY-SA-4.0, MIT, MIT-0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMetadataForPath

func GetMetadataForPath(filepath string) (any, error)

func MakePointer

func MakePointer[T any](x T) *T

func TransmogrifyCbor

func TransmogrifyCbor[T any](meta map[any]any) (*T, bool)

Types

type CommonMetadata

type CommonMetadata struct {
	CreatedTime *time.Time `cbor:"createdTime,omitempty"`
	FileSize    *uint64    `cbor:"fileSize,omitempty"`
	MimeType    *string    `cbor:"mimetype,omitempty"`
	Comment     *string    `cbor:"comment,omitempty"`
}

The common metadata that is used by all forms By all technical means, there is no "required" metadata.

type DarwinMetadata

type DarwinMetadata struct {
	UNIXMetadata
}

MacOS/Darwin metadata: Just UNIX, for now.

type LinuxMetadata

type LinuxMetadata struct {
	UNIXMetadata
	SelinuxLabel   *string `cbor:"selinux_label,omitempty"`
	SelinuxContext *string `cbor:"selinux_context.omitempty"`
	Capabilities   *uint64 `cbor:"caps,omitempty"`
}

Linux metadata: SELinux additions and capability flags.

type POSIXMetadata

type POSIXMetadata struct {
	UNIXMetadata
	Acls *[]string `cbor:"acls,omitempty"`
}

POSIX metadata: UNIXy, but with the additonal list of ACLs

type UNIXMetadata

type UNIXMetadata struct {
	CommonMetadata
	Owner    *string            `cbor:"0,keyasint,omitempty"`
	Group    *string            `cbor:"1,keyasint,omitempty"`
	Mode     *uint16            `cbor:"2,keyasint,omitempty"`
	Attribs  *[]string          `cbor:"attr,omitempty"`
	Xattribs *map[string][]byte `cbor:"xattr,omitempty"`
}

UNIX style metadata: Owner, Group, Mode, and some additional flags.

type WinNTMetadata

type WinNTMetadata struct {
	CommonMetadata
	SddlString *string `cbor:"0,omitempty"`
	Attributes *uint16 `cbor:"1,omitempty"`
}

WinNT metadata: NT has no concept of owning users/modes, instead places ACLs on files based on common groupings and such. Files have a bitfield of various attributes, as well.

Jump to

Keyboard shortcuts

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