metadata

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateLength

func CalculateLength(path string) (int64, error)

CalculateLength returns the play duration of a media file like a .mp3

Types

type Metadata

type Metadata struct {
	Name        string `json:"name" yaml:"name"`
	Size        int64  `json:"size" yaml:"size"`
	Duration    int64  `json:"duration,omitempty" yaml:"duration,omitempty"`
	ContentType string `json:"type" yaml:"type"`
	Timestamp   int64  `json:"timestamp" yaml:"timestamp"`
	ETag        string `json:"etag" yaml:"etag"`
}

Metadata keeps basic metadata of a cdn resource

func CreateMetadata

func CreateMetadata(fi fs.FileInfo) Metadata

func ExtractMetadataFromFile

func ExtractMetadataFromFile(path string) (*Metadata, error)

func ExtractMetadataFromHeader

func ExtractMetadataFromHeader(header http.Header) *Metadata

ExtractMetadataFromHeader extracts the metadata from http.Response

func LoadMetadataResource

func LoadMetadataResource(path string) (*Metadata, error)

func (*Metadata) IsAudio

func (m *Metadata) IsAudio() bool

func (*Metadata) IsImage

func (m *Metadata) IsImage() bool

Jump to

Keyboard shortcuts

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