util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

func Base(a string) string

Base returns the filename without the suffix.

func GetCanonicalName

func GetCanonicalName(config *config.Config, media *mediainfo.Media, index int) string

GetCanonicalPhotoName creates a standardize photo file name for one of the specific photo files that looks like <date>-<time>-<camera-model>-<filename>.jpg

func GetFile

func GetFile(ctx context.Context, client *storage.Client, attrs *storage.ObjectAttrs, file *os.File) (*mediainfo.FileInfo, error)

GetFile retrieves a file and returns the MD5, SHA256, file name, and file size. If a file was passed in it stores the file there.

func MD5

func MD5(a []byte) [16]byte

MD5 returns a 16 byte array.

func Sha256

func Sha256(a []byte) [32]byte

Sha256 returns a 32 byte array.

func Suffix

func Suffix(a string) string

Suffix returns the suffix of the filename.

Types

type Tags

type Tags struct {
	A []string
	B []string
}

Tags ...

func (*Tags) Match

func (tags *Tags) Match(labelList []string) bool

Match ....

func (*Tags) Modify

func (tags *Tags) Modify(labelList []string) ([]string, bool)

Modify ...

func (*Tags) Normalize

func (tags *Tags) Normalize()

Normalize ...

func (*Tags) Validate

func (tags *Tags) Validate(allowed []string)

Validate ...

Jump to

Keyboard shortcuts

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