utils

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 11 Imported by: 0

README

Utils - they do things.. useful things.. uncategorisable things

Some homeless utilities. They probably aren't useful to you.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrCredentialsNotCorrect invalid credentials message
	ErrCredentialsNotCorrect = errors.New("supplied credentials cannot be verified")
)

Functions

func DrainFn

func DrainFn(c <-chan interface{})

DrainFn drains a channel until it is closed

func EmailIsValid

func EmailIsValid(emailAddress string) bool

EmailIsValid checks the email string

func FromAvroFile

func FromAvroFile(ctx context.Context, filename string, bufferSize int) <-chan interface{}

FromAvroFile sends back a map of content from an avro file

func GetHashCompare

func GetHashCompare(inString string, inCmpHash string) (bool, error)

GetHashCompare compares a string with the password hash

func GetStringHash

func GetStringHash(inString string) (string, error)

GetStringHash hashes a plain text password string

func NewDsKey

func NewDsKey(ctx context.Context, dsClient *datastore.Client, dsNS, dsKind string) (*datastore.Key, error)

NewDsKey is datastore specific and returns a key using datastore.AllocateIDs

func NewID

func NewID() string

NewID returns a new ID from ksuid

func NewIDs

func NewIDs(n int) []string

NewIDs returns n new IDs from ksuid

func ToAvroFile

func ToAvroFile(ctx context.Context, filename, compressiontype string, codec *goavro.Codec, data <-chan interface{}) error

ToAvroFile writes data from a channel into an Avro file

Types

This section is empty.

Jump to

Keyboard shortcuts

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