ffm

package
v2.3.24 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServiceNotFound           = apperr.New("service_not_found")
	ErrInvalidFilter             = apperr.New("service_invalid_filter")
	ErrObjectIsNotFile           = apperr.New("service_object_is_not_file")
	ErrInvalidFileExt            = apperr.New("service_invalid_file_ext")
	ErrObjectIsNotDir            = apperr.New("service_object_is_not_dir")
	ErrObjectIsNotFound          = apperr.New("service_object_is_not_found")
	ErrCreateDirectory           = apperr.New("service_create_directory")
	ErrObjectRemove              = apperr.New("service_object_remove")
	ErrObjectIsAlreadyExists     = apperr.New("service_object_is_already_exists")
	ErrObjectNoWritePermissions  = apperr.New("service_object_no_write_permissions")
	ErrObjectNoRemovePermissions = apperr.New("service_object_no_remove_permissions")
	ErrDecode                    = apperr.New("service_decode")
	ErrRemoveObject              = apperr.New("service_remove_object")
	ErrNoPermissionsToRemoveFile = apperr.New("service_no_permissions_to_remove_file")
	ErrNoPermissionsToCreateFile = apperr.New("service_no_permissions_to_create_file")
	ErrNoPermissionsToRemoveDir  = apperr.New("service_no_permissions_to_remove_dir")
	ErrNoPermissionsToCreateDir  = apperr.New("service_no_permissions_to_create_dir")
	ErrNoPermissionsToDownload   = apperr.New("service_no_permissions_to_download")
)

Functions

This section is empty.

Types

type DecodeMp3Request

type DecodeMp3Request struct {
	Path            string `json:"path" url:"path"`
	DeleteOriginal  bool   `json:"delete_original" url:"delete_original"`
	ReplaceIfExists bool   `json:"replace_if_exists" url:"replace_if_exists"`
}

type ErrorResponse

type ErrorResponse struct {
	ID     string        `json:"id"`
	Text   string        `json:"text"`
	Errors []interface{} `json:"errors"`
}

type FFM

type FFM struct {
	// contains filtered or unexported fields
}

func (*FFM) DecodeMp3

func (f *FFM) DecodeMp3(ctx context.Context, request DecodeMp3Request) (*FileInfoResponse, error)

func (*FFM) Info

func (f *FFM) Info(ctx context.Context, path string) (*FileInfoResponse, error)

func (*FFM) LS

func (f *FFM) LS(ctx context.Context, request LSRequest) ([]FileInfoResponse, error)

func (*FFM) MkDir

func (f *FFM) MkDir(ctx context.Context, request MkDirRequest) (*FileInfoResponse, error)

func (*FFM) Remove

func (f *FFM) Remove(ctx context.Context, request RemoveRequest) error

func (*FFM) Upload

func (f *FFM) Upload(ctx context.Context, request UploadRequest) ([]FileInfoResponse, error)

type FileInfoResponse

type FileInfoResponse struct {
	Path     string    `json:"path"`
	FullPath string    `json:"full_path"`
	Name     string    `json:"name"`
	Size     int64     `json:"size"`
	IsDir    bool      `json:"is_dir"`
	ModTime  time.Time `json:"mod_time"`
}

type FileManager

type FileManager interface {
	LS(ctx context.Context, request LSRequest) ([]FileInfoResponse, error)
	Info(ctx context.Context, path string) (*FileInfoResponse, error)
	MkDir(ctx context.Context, request MkDirRequest) (*FileInfoResponse, error)
	DecodeMp3(ctx context.Context, request DecodeMp3Request) (*FileInfoResponse, error)
	Upload(ctx context.Context, request UploadRequest) ([]FileInfoResponse, error)
	Remove(ctx context.Context, request RemoveRequest) error
}

func New

func New(addr, service, debug string) (FileManager, error)

type LSRequest

type LSRequest struct {
	Path          string  `json:"path" url:"path"`
	Recursive     bool    `json:"recursive" url:"recursive"`
	FileFilter    *string `json:"file_filter" url:"file_filter"`
	DirFilter     *string `json:"dir_filter" url:"dir_filter"`
	SkipDirs      bool    `json:"skip_dirs" url:"skip_dirs"`
	SkipEmptyDirs bool    `json:"skip_empty_dirs" url:"skip_empty_dirs"`
	SkipPath      bool    `json:"skip_path" url:"skip_path"`
}

type MkDirRequest

type MkDirRequest struct {
	Path              string `json:"path" url:"path"`
	Dir               string `json:"dir" url:"dir"`
	Recursive         bool   `json:"recursive" url:"recursive"`
	IgnoreExistsError bool   `json:"ignore_exists_error" url:"ignore_exists_error"`
}

type PathRequest

type PathRequest struct {
	Path string `json:"path" url:"path"`
}

type RemoveRequest

type RemoveRequest struct {
	Path                string `json:"path"`
	IgnoreNotFoundError bool   `json:"ignore_not_found_error"`
	OnlyChildren        bool   `json:"only_children"`
}

type UploadFileRequest

type UploadFileRequest struct {
	Name   string
	Reader io.Reader
}

type UploadRequest

type UploadRequest struct {
	Path   string
	Files  []UploadFileRequest
	Append bool
}

Jump to

Keyboard shortcuts

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