util

package
v0.0.0-...-a4db070 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NilTrie = Trie{}
)

Functions

func CamelToSnake

func CamelToSnake(s string) string

func FuncNameToPath

func FuncNameToPath(s string) string

func Js

func Js(x interface{}) string

func PascalSplit

func PascalSplit(s string) (ss []string)

func PascalToSnake

func PascalToSnake(s string) string

Types

type PathVar

type PathVar struct {
	Pos int    //starts from 0
	Var string //typeChar + '.' + varname
}

func FuncNameToPathWithVars

func FuncNameToPathWithVars(s string, varsType []reflect.Kind) (pathFormat string, vars []PathVar, e error)
	path element,
 		upper leading - path component
		lower leading - path variable
	{s} - string
	{i} - integer
	{f} - number

type Trie

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

func NewTrie

func NewTrie() Trie

func (Trie) Add

func (t Trie) Add(path []string, value int)

func (Trie) Dump

func (t Trie) Dump()

func (Trie) Empty

func (t Trie) Empty() bool

func (Trie) Find

func (t Trie) Find(path []string) (result Trie, found bool)

func (Trie) Map

func (t Trie) Map() map[string]int

func (Trie) String

func (t Trie) String() string

func (Trie) Sub

func (t Trie) Sub(key string) Trie

func (Trie) Traverse

func (t Trie) Traverse(do func([]string, Trie) bool)

do returns bool means: CONTINUE or not

func (Trie) Valid

func (t Trie) Valid() bool

func (Trie) Value

func (t Trie) Value() *int

Jump to

Keyboard shortcuts

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