ext

package
v0.15.22 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MinInt

func MinInt(a, b int) int

func SliceContainsString added in v0.9.0

func SliceContainsString(slice []string, value string) bool

SliceContainsString returns true if the specified slice of strings contains the give value, false otherwise.

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock wraps the Now method. Introduced to allow replacing the global state with fixed clocks to facilitate testing. Now returns the current time.

func NewFixedClock

func NewFixedClock(fixedTime time.Time) Clock

func NewSystemClock

func NewSystemClock() Clock

type IDGenerator added in v0.7.0

type IDGenerator interface {
	// GenerateID generates a new identifier.
	GenerateID() string
}

IDGenerator defines contract for generating universally unique identifiers.

func NewGoogleUUIDGenerator added in v0.7.0

func NewGoogleUUIDGenerator() IDGenerator

NewGoogleUUIDGenerator constructs a new IDGenerator implemented with Google's UUID module.

func NewSimpleIDGenerator added in v0.7.0

func NewSimpleIDGenerator() IDGenerator

NewSimpleIDGenerator constructs a simple IDGenerator that starts at 1, increments up to 999999999999, and then rolls over.

Jump to

Keyboard shortcuts

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