util

package
v3.0.36 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 3 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     int32
	OppID  int32
	Weight int32
	Name   string
}

type Graph

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

func NewGraph

func NewGraph() *Graph

Create a new graph

func (*Graph) AddEdge

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

AddEdge adds a new edge to the graph

func (*Graph) AddNode

func (g *Graph) AddNode() int32

AddNode adds a new node to the graph

func (*Graph) AllPaths

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

AllPaths returns all paths between two nodes

func (*Graph) Connections

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

Connections returns all connections for a given node

func (*Graph) GetEdges

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

GetEdges returns all edges between the two nodes

func (*Graph) UpdateEdge

func (g *Graph) UpdateEdge(
	from, to, edgeID, oppEdgeID int32,
) error

UpdateEdge updates the edge with the given ID

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