navigation

package
v0.0.0-...-d598083 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UPDIR = ".."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CWD

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

func NewCWD

func NewCWD(top string) CWD

func (CWD) CurrentItem

func (cwd CWD) CurrentItem() (string, error)

func (CWD) CurrentLevel

func (cwd CWD) CurrentLevel() Level

func (CWD) CurrentPathBuffer

func (cwd CWD) CurrentPathBuffer() map[Level]string

func (CWD) Down

func (cwd CWD) Down(name string) CWD

func (CWD) IsTop

func (cwd CWD) IsTop() bool

func (CWD) SetLevel

func (cwd CWD) SetLevel(lvl Level) CWD

func (CWD) String

func (cwd CWD) String() string

func (CWD) Up

func (cwd CWD) Up() CWD

type Command

type Command struct {
	Method RunMethod
	// contains filtered or unexported fields
}

func MakeAllLevelCommand

func MakeAllLevelCommand(cmd string, helptext string, meth RunMethod) Command

func (Command) Check

func (c Command) Check(args []string) (string, error)

type Level

type Level int
const (
	Root        Level = 0
	Project     Level = 1
	Module      Level = 2
	Package     Level = 3
	StructInter Level = 4
)

func (Level) String

func (s Level) String() string
type Navigator struct {
	// contains filtered or unexported fields
}

func NewNavigator

func NewNavigator(top string) *Navigator
func (n *Navigator) AddCommand(c Command)
func (n *Navigator) CheckCreate(pname string) error
func (n *Navigator) Level() string
func (n *Navigator) ReadCommand() []string
func (n *Navigator) RunCommand(cmd string, args []string) (error, []string, bool)
func (n *Navigator) String() string

type RunMethod

type RunMethod func(n *Navigator, args []string) (error, []string, bool)

Jump to

Keyboard shortcuts

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