Documentation ¶
Index ¶
- Constants
- func IsContentTypeSupported(c ContentType) bool
- type Body
- type ContentLength
- type ContentType
- type DerivedMedia
- type DownloadResponse
- 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) SetDir(dir string) Path
- func (p *Path) SetExtension(ext string) Path
- func (p *Path) ToString() string
- func (p *Path) Uuid() string
- type PathFactory
- type ReadManyInput
- 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 = int64
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 DownloadResponse ¶
type DownloadResponse struct { 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) (*DownloadResponse, error) DownloadArchive(p []Path) (Body, error) ReadOne(p Path) (*FileInfo, error) ReadMany(p Path) ([]FileInfo, error) Move(src, dst Path) error Copy(src, dst Path) error Delete(p Path) error SpaceUsage() (float64, 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 (*Path) AppendSuffix ¶
func (*Path) SetExtension ¶
type PathFactory ¶
type PathFactory struct { }
func (*PathFactory) BuildDerivedMedisPath ¶
func (f *PathFactory) BuildDerivedMedisPath(m Media) Path
type ReadManyInput ¶
type UploadInput ¶
type UploadInput struct { Path Path Body io.Reader ContentType ContentType ContentLength ContentLength }
Click to show internal directories.
Click to hide internal directories.