utils

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: BSD-2-Clause, ISC Imports: 3 Imported by: 0

Documentation

Overview

Package utils provides common utility functions.

Provided functionalities: - sorting - comparators

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeComparator

func TimeComparator(a, b time.Time) int

TimeComparator provides a basic comparison on time.Time

func ToString

func ToString(value interface{}) string

ToString converts a value to string.

Types

type Comparator

type Comparator[K any] func(key1, key2 K) int

type Comparator2 added in v0.9.3

type Comparator2[K any, S any] func(search S, key K) int

A Comparator2 is used by Get(Node)2, Ceiling2 and Floor2. The actual comparator function must assert, convert or otherwise parse search as needed.

Jump to

Keyboard shortcuts

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