cmd

package
v0.0.0-...-f0f907b Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTUSHeadFileUploadOffsetMissing = errors.New("filebrowserui-session: tus api endpoint response is missing the upload-offset header")
	ErrTUSHeadFileUploadOffsetInvalid = errors.New("filebrowserui-session: tus api endpoint response upload-offset < 0, this is invalid TUS")
)

Functions

func NewNodeWidget

func NewNodeWidget() *nodeWidget

func Run

func Run() (err error)

func ShowDismissablePopup

func ShowDismissablePopup(window fyne.Window, msg string)

Types

type Config

type Config struct {
	User string `json:"user"`
	Pass string `json:"pass"`

	// Host is the full URI of the host.
	// Ex: https://filebrowser.clayton.coffee
	Host string `json:"host"`

	// Dir is the parent folder that contains our files.
	// Ex: ~/.config/filebrowser/
	Dir string `json:"-"`
	// contains filtered or unexported fields
}

func GetConfig

func GetConfig() *Config

type ErrResumable

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

ErrResumable instructs the caller that the error that was returned is resumable, and likely should be called until it returns no error. This happens because of transient errors like io.ErrUnexpectedEOF when the http request unexpectedly is closed before finishing.

func (ErrResumable) Error

func (e ErrResumable) Error() string

func (ErrResumable) Unwrap

func (e ErrResumable) Unwrap() error

type Node

type Node struct {
	*Resource
}

type NodeCache

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

NodeCache is a non-optimal cache that does cache things but sometimes multiple requests for the same object will result in multiple filebrowser request, but eventually will keep them in cache

func NewNodeCache

func NewNodeCache(sess *filebrowserSession) *NodeCache

func (*NodeCache) Info

func (nc *NodeCache) Info(ctx context.Context, path string) (*Resource, error)

type Resource

type Resource struct {
	// These fields exist only for Directories
	// TODO: maybe make these fields pointers, or move them to another struct
	Items []struct {
		Path      string    `json:"path"`
		Name      string    `json:"name"`
		Size      int       `json:"size"`
		Extension string    `json:"extension"`
		Modified  time.Time `json:"modified"`
		Mode      int64     `json:"mode"`
		IsDir     bool      `json:"isDir"`
		IsSymlink bool      `json:"isSymlink"`
		Type      string    `json:"type"`
	} `json:"items"`
	NumDirs  int `json:"numDirs"`
	NumFiles int `json:"numFiles"`
	Sorting  struct {
		By  string `json:"by"`
		Asc bool   `json:"asc"`
	} `json:"sorting"`

	// Every resource will have these aspects
	Path      string    `json:"path"`
	Name      string    `json:"name"`
	Size      int       `json:"size"`
	Extension string    `json:"extension"`
	Modified  time.Time `json:"modified"`
	Mode      int64     `json:"mode"`
	IsDir     bool      `json:"isDir"`
	IsSymlink bool      `json:"isSymlink"`
	Type      string    `json:"type"`
}

Jump to

Keyboard shortcuts

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