treemap

package
v0.0.0-...-221e590 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package treemap Based on https://github.com/Tufin/asciitree

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoxType

type BoxType int
const (
	Regular BoxType = iota
	Last
	AfterLast
	Between
)

func (BoxType) String

func (boxType BoxType) String() string

type Tree

type Tree map[string]Tree

Tree can be any map with: 1. Key that has method 'String() string' 2. Value is Tree itself You can replace this with your own tree

func (Tree) Add

func (tree Tree) Add(path string)

func (Tree) Delete

func (tree Tree) Delete(path string)

func (Tree) Fprint

func (tree Tree) Fprint(w io.Writer, root bool, padding string)

func (Tree) Search

func (tree Tree) Search(path string) Tree

type TreeMap

type TreeMap struct {
	Node     *TreeNode
	NextTree map[string]*TreeMap
}

func NewTreeMap

func NewTreeMap() *TreeMap

func NewTreeMapWithPaths

func NewTreeMapWithPaths(paths []string) *TreeMap

func (*TreeMap) Add

func (t *TreeMap) Add(path string)

func (*TreeMap) AddPaths

func (t *TreeMap) AddPaths(paths []string)

func (*TreeMap) Delete

func (t *TreeMap) Delete(path string)

func (*TreeMap) Init

func (t *TreeMap) Init(url, value string)

func (*TreeMap) LeafNodesWithUrl

func (t *TreeMap) LeafNodesWithUrl() []string

func (*TreeMap) Purge

func (t *TreeMap) Purge()

func (*TreeMap) Search

func (t *TreeMap) Search(path string) *TreeMap

func (*TreeMap) SearchUrls

func (t *TreeMap) SearchUrls(path string) []string

type TreeNode

type TreeNode struct {
	Url   string
	Value string
}

func NewTreeNode

func NewTreeNode() *TreeNode

func (*TreeNode) Init

func (n *TreeNode) Init(url, value string)

Jump to

Keyboard shortcuts

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