utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsPath

func AbsPath[T any](path string, base T) string

func ConvertSlice

func ConvertSlice[SRC any, DST any](src []SRC, converter func(SRC) DST) []DST

func CopyDir

func CopyDir(srcFS fs.FS, src, dst string) error

func SnakeCase

func SnakeCase(s string) string

Types

type OrderedMap

type OrderedMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

OrderedMap map with a track or entry order. Not concurrent safe Not designed for high performance Not for frequent set and delete

func NewOrderedMap

func NewOrderedMap[K comparable, V any]() *OrderedMap[K, V]

func NewOrderedMapWithCap

func NewOrderedMapWithCap[K comparable, V any](cap int) *OrderedMap[K, V]

func (*OrderedMap[K, V]) Delete

func (m *OrderedMap[K, V]) Delete(k K) bool

func (*OrderedMap[K, V]) Get

func (m *OrderedMap[K, V]) Get(k K) V

func (*OrderedMap[K, V]) Keys

func (m *OrderedMap[K, V]) Keys() []K

func (*OrderedMap[K, V]) Len

func (m *OrderedMap[K, V]) Len() int

func (*OrderedMap[K, V]) Lookup

func (m *OrderedMap[K, V]) Lookup(k K) (v V, ok bool)

func (*OrderedMap[K, V]) Set

func (m *OrderedMap[K, V]) Set(k K, v V)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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