app

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package app implements the arag terminal user interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionConfig

type ConnectionConfig struct {
	BaseURL  string
	Username string
	Password string
}

ConnectionConfig contains credentials entered for one WebDAV session.

type ConnectionDefaults

type ConnectionDefaults struct {
	BaseURL  string
	Username string
}

ConnectionDefaults pre-fills non-sensitive connection fields.

type DirectoryReader

type DirectoryReader interface {
	ReadDir(context.Context, *url.URL) ([]webdav.Entry, error)
}

DirectoryReader lists the contents of a WebDAV directory.

type Model

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

Model stores the state of the arag terminal interface.

func NewConnectionModel

func NewConnectionModel(
	ctx context.Context,
	factory SessionFactory,
	defaults ConnectionDefaults,
) *Model

NewConnectionModel creates a model that starts with a WebDAV connection form and transitions to the browser after authentication succeeds.

func NewModel

func NewModel(ctx context.Context, client DirectoryReader, videoPlayer player.Player) *Model

NewModel creates a model that loads the configured WebDAV root.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init detects the terminal theme and starts loading the WebDAV root outside the rendering path.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles WebDAV results, terminal resizing, and keyboard input.

func (*Model) View

func (m *Model) View() tea.View

View renders the current state without performing I/O or business logic.

type Session

type Session struct {
	Client  DirectoryReader
	Player  player.Player
	Entries []webdav.Entry
}

Session contains the authenticated dependencies required by the browser.

type SessionFactory

type SessionFactory func(context.Context, ConnectionConfig) (Session, error)

SessionFactory authenticates a WebDAV session and loads its root entries.

Jump to

Keyboard shortcuts

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