file

package module
v0.0.0-...-6deb74b Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	Size        int64             `json:"size,omitempty"`
	ContentType string            `json:"contentType,omitempty"`
	Digest      map[string]string `json:"digest,omitempty"`
	MediaAttributes
	Info
}

func ResolveAttrs

func ResolveAttrs(b blob.Blob, opts ...Option) (Attributes, error)

func (Attributes) Equal

func (a1 Attributes) Equal(a2 Attributes) bool

func (Attributes) Ext

func (a Attributes) Ext() string

func (Attributes) IsStale

func (a Attributes) IsStale(d fs.DirEntry) bool

func (Attributes) Type

func (a Attributes) Type() string

type Info

type Info struct {
	ModTime *time.Time  `json:"modTime,omitempty"`
	Mode    os.FileMode `json:"-"`
	IsDir   bool        `json:"isDir,omitempty"`
}

func NewInfo

func NewInfo(in os.FileInfo) (out Info)

type MediaAttributes

type MediaAttributes struct {
	Width      int     `json:"width,omitempty"`
	Height     int     `json:"height,omitempty"`
	Duration   float64 `json:"duration,omitempty"`
	HasAudio   bool    `json:"hasAudio,omitempty"`
	FrameCount int     `json:"frameCount,omitempty"`
}

func (MediaAttributes) AspectRatio

func (ma MediaAttributes) AspectRatio() float64

func (MediaAttributes) Megapixels

func (ma MediaAttributes) Megapixels() float64

type Option

type Option func(a *Attributes, b blob.Blob, contentType string) error

func Digests

func Digests(h ...crypto.Hash) Option

func MediaAttrs

func MediaAttrs() Option

Directories

Path Synopsis
format
raw

Jump to

Keyboard shortcuts

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