Documentation
¶
Overview ¶
Package misc implements miscellaneous functions.
Package misc implements miscellaneous functions.
Index ¶
- func Atoi64(s string) (int64, error)
- func Attribute[S, A any](seq iter.Seq[S], a A) iter.Seq2[S, A]
- func CalculateEndpoint(begin time.Time, end time.Time) time.Time
- func CompareEmptyStrings(a, b *string) int
- func EmptyString(s *string) string
- func EncodePassword(password string) string
- func Filter[S any](seq iter.Seq[S], cond func(S) bool) iter.Seq[S]
- func Join2[K, V any](seqs ...iter.Seq2[K, V]) iter.Seq2[K, V]
- func Map[S, T any](seq iter.Seq[S], xform func(S) T) iter.Seq[T]
- func NilChanger(changed *bool, s **string, v string)
- func NilString(s string) *string
- func ParseSeq[S, T any](seq iter.Seq[S], parse func(S) (T, error)) iter.Seq[T]
- func ParseSeq2[S, K, V any](seq iter.Seq[S], parse func(S) (K, V, error)) iter.Seq2[K, V]
- func RandomString(n int) string
- func Shorten(v any) string
- func Values[S any](args ...S) iter.Seq[S]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Atoi64 ¶ added in v0.2.0
Atoi64 is a strconv.Atoi like wrapper for int64s.
func CalculateEndpoint ¶ added in v0.3.0
CalculateEndpoint determines whether time.Now is happening during a duration from a set point in time. If it is, then time.Now() is returned, otherwise the endpoint of the duration is returned.
func CompareEmptyStrings ¶ added in v0.2.0
CompareEmptyStrings compares to strings.
func EmptyString ¶ added in v0.2.0
EmptyString returns an empty string if the pointer is nil the dereferenced string otherwise.
func EncodePassword ¶
EncodePassword encodes a password to be stored in the database.
func NilChanger ¶ added in v0.2.0
NilChanger updates a potential nil string.
func NilString ¶ added in v0.2.0
NilString returns nil if the given string is empty else a pointer to the string is returned.
func ParseSeq ¶ added in v0.2.0
ParseSeq parses the elements of a given sequence with a given parse function and returns a sequence of the parsing results that do not fail to parse.
func ParseSeq2 ¶ added in v0.3.0
ParseSeq2 parses the elements of a given sequence with a given parse function and returns a sequence of the parsing results that do not fail to parse.
func RandomString ¶
RandomString generates a random string of length n.
Types ¶
This section is empty.