util

package
v0.17.19 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToCamel

func ToCamel(s string) string

ToCamel converts a string to lowerCamelCase

func ToScreamingDelimited

func ToScreamingDelimited(s string, delimiter uint8, ignore uint8, screaming bool) string

func ToSnake

func ToSnake(s string) string

Types

type Edge

type Edge struct {
	ID, Weight int32
	Name       string
}

type Graph

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

func NewGraph

func NewGraph() *Graph

func (*Graph) AddEdge

func (g *Graph) AddEdge(from, to, weight int32, name string) (int32, error)

func (*Graph) AddNode

func (g *Graph) AddNode() int32

func (*Graph) AllPaths

func (g *Graph) AllPaths(from, to int32) [][]int32

func (*Graph) Connections

func (g *Graph) Connections(n int32) []int32

func (*Graph) GetEdges

func (g *Graph) GetEdges(from, to int32) []Edge

type Once

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

Once is an object that will perform exactly one action until Reset is called. See http://golang.org/pkg/sync/#Once

func (*Once) Do

func (o *Once) Do(f func())

Do simulates sync.Once.Do by executing the specified function only once, until Reset is called. See http://golang.org/pkg/sync/#Once

func (*Once) Reset

func (o *Once) Reset()

Reset indicates that the next call to Do should actually be called once again.

type StackInf

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

func NewStackInf

func NewStackInf() *StackInf

Create a new StackInf

func (*StackInf) Len

func (s *StackInf) Len() int

Return the number of items in the StackInf

func (*StackInf) Peek

func (s *StackInf) Peek() interface{}

View the top item on the StackInf

func (*StackInf) Pop

func (s *StackInf) Pop() interface{}

Pop the top item of the StackInf and return it

func (*StackInf) Push

func (s *StackInf) Push(value interface{})

Push a value onto the top of the StackInf

type StackInt32

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

func NewStackInt32

func NewStackInt32() *StackInt32

Create a new StackInt32

func (*StackInt32) Len

func (s *StackInt32) Len() int

Return the number of items in the StackInt32

func (*StackInt32) Peek

func (s *StackInt32) Peek() int32

View the top item on the StackInt32

func (*StackInt32) Pop

func (s *StackInt32) Pop() int32

Pop the top item of the StackInt32 and return it

func (*StackInt32) Push

func (s *StackInt32) Push(value int32)

Push a value onto the top of the StackInt32

Jump to

Keyboard shortcuts

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