Documentation ¶
Index ¶
- Constants
- func IsContentTypeSupported(c ContentType) bool
- type Body
- type ContentLength
- type ContentType
- type DerivedMedia
- type DownloadResult
- type FileInfo
- type FileStorer
- type Media
- type Metadata
- type Path
- func (p *Path) AppendSuffix(suffix string) Path
- func (p *Path) BasePath() Path
- func (p *Path) Basename() string
- func (p *Path) Dir() string
- func (p *Path) Extension() string
- func (p *Path) Filename() string
- func (p *Path) SetExtension(ext string) Path
- func (p *Path) ToString() string
- func (p *Path) Uuid() string
- func (p *Path) WithDir(dir string) Path
- type SortBy
- type Storer
- type Tag
- type UploadInput
Constants ¶
View Source
const ( Asc = "asc" Desc = "desc" )
Variables ¶
This section is empty.
Functions ¶
func IsContentTypeSupported ¶
func IsContentTypeSupported(c ContentType) bool
Types ¶
type ContentLength ¶
type ContentLength = int
type ContentType ¶
type ContentType = string
const ( ImageJpg ContentType = "image/jpg" ImageJpeg ContentType = "image/jpeg" ImagePng ContentType = "image/png" ImageWebp ContentType = "image/webp" VideoMp4 ContentType = "video/mp4" VideoMkv ContentType = "video/x-matroska" )
type DerivedMedia ¶
type DerivedMedia struct { Path Body Body `json:"-"` ContentType ContentType `json:"content_type,omitempty"` ContentLength ContentLength `json:"content_length,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
type DownloadResult ¶
type DownloadResult struct { Path Path Body io.ReadCloser ContentType ContentType ContentLength int64 }
type FileInfo ¶
type FileInfo struct { Path ContentType ContentType `json:"content_type,omitempty"` ContentLength ContentLength `json:"content_length,omitempty"` }
type FileStorer ¶
type FileStorer interface { Upload(in UploadInput) error Download(p Path) (*DownloadResult, error) DownloadMultiple(p []Path) ([]*DownloadResult, error) Get(p Path) (*FileInfo, error) GetMultiple(p Path) ([]FileInfo, error) Move(src, dst Path) error Copy(src, dst Path) error Delete(p Path) error SpaceUsage() (int64, error) }
type Media ¶
type Media struct { Path Body Body `json:"-"` ContentType ContentType `json:"content_type,omitempty"` ContentLength ContentLength `json:"content_length,omitempty"` EmbeddedMetadata Metadata `json:"embedded_metadata,omitempty"` Tags []Tag `json:"tags,omitempty"` DerivedMedias []DerivedMedia `json:"derived_medias,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
type Path ¶
type Path struct {
Path string `json:"path"`
}
func BuildDerivedPath ¶
func (*Path) AppendSuffix ¶
func (*Path) SetExtension ¶
type UploadInput ¶
type UploadInput struct { Path Path Body io.Reader ContentType ContentType ContentLength ContentLength }
Click to show internal directories.
Click to hide internal directories.