eagle

package
v0.0.0-...-0a83a3a Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParseJson

func MustParseJson[T any, P Ptr[T]](pth string, v P) error

mustUnmarshalFromFile unmarshals data from a file into the provided pointer. it panics if path does not exist.

func ParseItemMetadata

func ParseItemMetadata[T any, P Ptr[T]](pth string, v P) error

func PopulateLibraries

func PopulateLibraries(e *Eagle) error

fills out Eagle.Libraries returns a LibrariesImportErr or nil

Types

type Eagle

type Eagle struct {
	Libraries   []Library
	Directories []Folder
}

func New

func New() (Eagle, error)

func (*Eagle) MetadataParse

func (e *Eagle) MetadataParse()

func (*Eagle) MtimeCount

func (e *Eagle) MtimeCount() (int, error)

type Folder

type Folder struct {
	Name string
	Path string
}

user custom folder enabling use of certain api functions over this folder...

type Image

type Image struct {
	Id           string   `json:"id"`
	Name         string   `json:"name"`
	Size         int      `json:"size"`
	Ext          string   `json:"ext"`
	LastModified int      `json:"lastModified"` //eagleModTime
	Tags         []string `json:"tags"`
	Url          string   `json:"url"`
	Annotation   string   `json:"annotation"`
}

type LibrariesImportErr

type LibrariesImportErr struct {
	ImportError error
	FilePath    string
	LenBytes    int // is -1 if error happens
}

func (*LibrariesImportErr) Error

func (e *LibrariesImportErr) Error() string

type Library

type Library struct {
	Name string
	Path string
}

func (*Library) EnumJson

func (lib *Library) EnumJson()

func (*Library) FirstFiveImages

func (lib *Library) FirstFiveImages() []*Image

func (*Library) WalkImageDirs

func (lib *Library) WalkImageDirs() (items []string)

get metadata.json

type LibraryImportErr

type LibraryImportErr struct {
	ImportError error
	FilePath    string
}

func (*LibraryImportErr) Error

func (e *LibraryImportErr) Error() string

type LibraryNotExistErr

type LibraryNotExistErr struct {
	LibraryImportErr
}

type Ptr

type Ptr[T any] interface{ *T }

Ptr is a type constraint for pointers to any type.

Jump to

Keyboard shortcuts

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