utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunk

func Chunk[K comparable](slice []K, batchSize int) [][]K

FIXME: move to barelyhuman/go package Chunk - create batches of an arbitrary typed slice into the given batch size

func DoesSliceContain

func DoesSliceContain(dataSlice []string, toCompare string) bool

DoesSliceContain - check if a string slice contains a given string

func GetEnvDefault

func GetEnvDefault(key string, def string) (result string)

func PickField

func PickField[K interface{}, V comparable](iterator []K, returner func(K) V) (result []V)

FIXME: move to barelyhuman/go package PickField - pick the value of a particular field from a slice into it's own slice

Types

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(
	options ...WriterOptions,
) *Writer

func (*Writer) Error

func (wr *Writer) Error(msg string, values ...interface{})

func (*Writer) Info

func (wr *Writer) Info(msg string)

func (*Writer) Success

func (wr *Writer) Success(msg string, values ...interface{})

type WriterOptions

type WriterOptions func(w *Writer)

func WithSilent

func WithSilent(silent bool) WriterOptions

Jump to

Keyboard shortcuts

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