Documentation ¶
Index ¶
- func Between[T constraints.Ordered](v, lower, upper T) bool
- func NN(x, y float64) float64
- func NNZ(x, y float64) float64
- func Round2DP(x float64) float64
- func RoundTo(x, y float64) float64
- func ToFloat(v any) float64
- func ToInt(v any) int
- func ToString(v any) string
- func WriteToCSV(filename string, data interface{}, encoder ...any) error
- type CSVEncoder
- type ID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Between ¶
func Between[T constraints.Ordered](v, lower, upper T) bool
Between returns true if x >= lower and x <= upper.
func WriteToCSV ¶
WriteToCSV writes the given data to a CSV file, optionally using the given encoders to custom marshal specific types. Will write a header row if the given file is empty. Wraps github.com/jszwec/csvutil
Types ¶
type CSVEncoder ¶
CSVEncoder is a custom encoder for marhsalling types to CSV files.
type ID ¶
type ID string
ID is a unique identifier. Intended to wrap a ULID which is lexicographically sortable.
func NewIDWithTime ¶
NewIDWithTime returns a new ID with the given time as a seed.
Click to show internal directories.
Click to hide internal directories.