utils

package
v0.0.0-...-28ab204 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomString

func GenerateRandomString(length uint32) (string, error)

func GetKeyBytes

func GetKeyBytes(indexer string) []byte

func HashStringToUint64

func HashStringToUint64(str string) uint64

Types

type Edge

type Edge[T interface{}, W interface{}] struct {
	Weight W             `json:"weight"`
	Vertex *Vertex[T, W] `json:"vertex"`
}

type Graph

type Graph[T interface{}, W interface{}] struct {
	Vertices map[uint64]*Vertex[T, W] `json:"vertices"`
}

func (*Graph[T, W]) AddEdge

func (g *Graph[T, W]) AddEdge(key uint64, destKey uint64, weight W)

func (*Graph[T, W]) AddVertex

func (g *Graph[T, W]) AddVertex(key uint64, value T)

func (*Graph[T, W]) Neighbors

func (g *Graph[T, W]) Neighbors(key uint64) []T

type Vertex

type Vertex[T interface{}, W interface{}] struct {
	Value T                      `json:"value"`
	Edges map[uint64]*Edge[T, W] `json:"edges"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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