metadata

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 23 Imported by: 0

README

metadata package

This is for the metadata panel, fetching and rendering metadata. Since metadata fetching is not fully contained, some part of functionality is offloaded to main model

To-dos

  • Add unit tests
  • Finish required TODOs
  • Update coverage stats

Coverage

cd /path/to/ui/metadata
go test -cover

Current coverage is 0%

Documentation

Index

Constants

View Source
const (
	AttrsSupported = 22
	//nolint:staticcheck // reference name
	FS_SECRM_FL = 0x00000001 /* Secure deletion */
	//nolint:staticcheck // reference name
	FS_UNRM_FL = 0x00000002 /* Undelete */
	//nolint:staticcheck // reference name
	FS_COMPR_FL = 0x00000004 /* Compress file */
	//nolint:staticcheck // reference name
	FS_SYNC_FL = 0x00000008 /* Synchronous updates */
	//nolint:staticcheck // reference name
	FS_IMMUTABLE_FL = 0x00000010 /* Immutable file */
	//nolint:staticcheck // reference name
	FS_APPEND_FL = 0x00000020 /* writes to file may only append */
	//nolint:staticcheck // reference name
	FS_NODUMP_FL = 0x00000040 /* do not dump file */
	//nolint:staticcheck // reference name
	FS_NOATIME_FL = 0x00000080 /* do not update atime */
	//nolint:staticcheck // reference name
	FS_NOCOMP_FL = 0x00000400 /* Don't compress */
	//nolint:staticcheck // reference name
	FS_ENCRYPT_FL = 0x00000800 /* Encrypted file */
	//nolint:staticcheck // reference name
	FS_BTREE_FL = 0x00001000 /* btree format dir */
	//nolint:staticcheck // reference name
	FS_INDEX_FL = 0x00001000 /* hash-indexed directory */
	//nolint:staticcheck // reference name
	FS_IMAGIC_FL = 0x00002000 /* AFS directory */
	//nolint:staticcheck // reference name
	FS_JOURNAL_DATA_FL = 0x00004000 /* Reserved for ext3 */
	//nolint:staticcheck // reference name
	FS_NOTAIL_FL = 0x00008000 /* file tail should not be merged */
	//nolint:staticcheck // reference name
	FS_DIRSYNC_FL = 0x00010000 /* dirsync behaviour (directories only) */
	//nolint:staticcheck // reference name
	FS_TOPDIR_FL = 0x00020000 /* Top of directory hierarchies*/
	//nolint:staticcheck // reference name
	FS_HUGE_FILE_FL = 0x00040000 /* Reserved for ext4 */
	//nolint:staticcheck // reference name
	FS_EXTENT_FL = 0x00080000 /* Extents */
	//nolint:staticcheck // reference name
	FS_VERITY_FL = 0x00100000 /* Verity protected inode */
	//nolint:staticcheck // reference name
	FS_EA_INODE_FL = 0x00200000 /* Inode used for large EA */
	//nolint:staticcheck // reference name
	FS_EOFBLOCKS_FL = 0x00400000 /* Reserved for ext4 */
	//nolint:staticcheck // reference name
	FS_NOCOW_FL = 0x00800000 /* Do not cow file */
	//nolint:staticcheck // reference name
	FS_DAX_FL = 0x02000000 /* Inode is DAX */
	//nolint:staticcheck // reference name
	FS_INLINE_DATA_FL = 0x10000000 /* Reserved for ext4 */
	//nolint:staticcheck // reference name
	FS_PROJINHERIT_FL = 0x20000000 /* Create with parents projid */
	//nolint:staticcheck // reference name
	FS_CASEFOLD_FL = 0x40000000 /* Folder is case insensitive */
)

see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/fs.h Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)

Variables

This section is empty.

Functions

func GetBinaryArchitecture added in v1.6.0

func GetBinaryArchitecture(filePath string) (string, error)

Types

type Metadata

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

func GetMetadata

func GetMetadata(filePath string, metadataFocused bool, et *exiftool.Exiftool) Metadata

func NewMetadata

func NewMetadata(data [][2]string, filepath string, infoMsg string) Metadata

func (Metadata) GetData

func (m Metadata) GetData() [][2]string

func (Metadata) GetPath

func (m Metadata) GetPath() string

func (Metadata) GetValue

func (m Metadata) GetValue(key string) (string, error)

type Model

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

func New

func New() Model

func (*Model) DropMetadataIfInCache added in v1.6.0

func (m *Model) DropMetadataIfInCache(filepath string)

func (*Model) GetHeight added in v1.5.0

func (m *Model) GetHeight() int

func (*Model) GetMetadataExpectedFocused added in v1.5.0

func (m *Model) GetMetadataExpectedFocused() bool

func (*Model) GetMetadataLocation added in v1.5.0

func (m *Model) GetMetadataLocation() string

func (*Model) GetWidth added in v1.5.0

func (m *Model) GetWidth() int

func (*Model) IsBlank

func (m *Model) IsBlank() bool

func (*Model) ListDown

func (m *Model) ListDown()

Control metadata panel down

func (*Model) ListUp

func (m *Model) ListUp()

Control metadata panel up

func (*Model) MetadataLen

func (m *Model) MetadataLen() int

func (*Model) Render

func (m *Model) Render(metadataFocused bool) string

func (*Model) ResetRender

func (m *Model) ResetRender()

func (*Model) ResetRenderIfInvalid

func (m *Model) ResetRenderIfInvalid()

func (*Model) SetBlank

func (m *Model) SetBlank()

func (*Model) SetDimensions

func (m *Model) SetDimensions(width int, height int)

Should be at least 2x2 TODO : Validate this

func (*Model) SetInfoMsg

func (m *Model) SetInfoMsg(msg string)

func (*Model) SetMetadata

func (m *Model) SetMetadata(metadata Metadata, metadataFocused bool)

func (*Model) SetMetadataCache added in v1.5.0

func (m *Model) SetMetadataCache(metadata Metadata, metadataFocused bool)

func (*Model) SetMetadataLocationAndFocused added in v1.5.0

func (m *Model) SetMetadataLocationAndFocused(filepath string, metadataFocused bool)

func (*Model) UpdateMetadataIfExistsInCache added in v1.5.0

func (m *Model) UpdateMetadataIfExistsInCache(filepath string, metadataFocused bool) bool

Jump to

Keyboard shortcuts

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