tearouter

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Redirect

func Redirect(typ RedirectType, target ...string) tea.Cmd

Types

type ErrorMsg

type ErrorMsg struct {
	Err error
}

type Middleware

type Middleware func(targetPath string) (newPath string)

type Model

type Model struct {
	InitialRoute string
	Routes       []Route
	Middleware   Middleware
	// contains filtered or unexported fields
}

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type RedirectMsg

type RedirectMsg struct {
	Type   RedirectType
	Target string
}

type RedirectType

type RedirectType int
const (
	Go RedirectType = iota
	Push
	Replace
	Pop
)

type Route

type Route struct {
	Path    string
	Builder func() tea.Model
}

Directories

Path Synopsis
cmd
tearouter command
examples
basic command
internal
pkg

Jump to

Keyboard shortcuts

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