model

package
v0.0.0-...-97a6ba0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datasource

type Datasource struct {
	gocrud.Base
	Name string `json:"name"`
	Type Type   `json:"type"`
	Cwd  string `json:"cwd"`
}

type DatasourceFS

type DatasourceFS interface {
	Open(name string) (File, error)
	ReadDir(name string) ([]fs.DirEntry, error)
}

func GetFS

func GetFS(datasource Datasource) (DatasourceFS, error)

type DuFS

type DuFS struct {
	DatasourceFS
	// contains filtered or unexported fields
}

func (*DuFS) Open

func (f *DuFS) Open(name string) (File, error)

func (*DuFS) ReadDir

func (f *DuFS) ReadDir(name string) ([]fs.DirEntry, error)

type File

type File interface {
	io.WriterTo
	Stat() (os.FileInfo, error)
}

type FileKey

type FileKey string

func BuildPreviewKey

func BuildPreviewKey(datasource Datasource, file string) FileKey

type LocalFS

type LocalFS struct {
	DatasourceFS
	// contains filtered or unexported fields
}

func (*LocalFS) Open

func (f *LocalFS) Open(name string) (File, error)

func (*LocalFS) ReadDir

func (f *LocalFS) ReadDir(name string) ([]fs.DirEntry, error)

type Preview

type Preview struct {
	gocrud.Base
	DatasourceID gocrud.ID `json:"datasourceId"`
	Key          FileKey   `json:"key"`
	Digest       string    `json:"digest" gorm:"type:varchar(64)"`
	Cover        string    `json:"cover"`
	MIME         string    `json:"mime"`
	FFProbeInfo  string    `json:"ffprobeInfo"`
}

func GeneratePreview

func GeneratePreview(datasource Datasource, srcFile, dstFolder string, finder func(digest string) (*Preview, error)) (*Preview, error)

type Type

type Type string
const (
	DUFS  Type = "dufs"
	LOCAL Type = "local"
)

Jump to

Keyboard shortcuts

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