package
0.231.0
Repository: https://github.com/nyaruka/goflow.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

Until encoding/json/v2 there's no easy way to ensure nil slices are marshalled as empty arrays see https://github.com/golang/go/discussions/63397.
FindPhoneNumbers finds phone numbers anywhere in the given string.
Indent indents each non-empty line in the given string.
IsValidAttachment returns whether the given string is a valid attachment.
ParsePhoneNumber tries to parse the given string as a phone number.
PrefixOverlap returns the number of prefix characters which s1 and s2 have in common.
ReadTypeFromJSON reads a field called `type` from the given JSON.
RegisterStructValidator registers a struct level validator.
RegisterValidatorAlias registers a tag alias.
RegisterValidatorTag registers a tag.
Set converts a slice to a set (a K > bool map).
Snakify turns the passed in string into a context reference.
StringSliceContains determines whether the given slice of strings contains the given string.
StringSlices returns the slices of s defined by pairs of indexes in indices.
TokenizeString returns the words in the passed in string, split by non word characters including emojis.
TokenizeStringByChars returns the words in the passed in string, split by the chars in the given string.
TokenizeStringByUnicodeSeg tokenizes the given string using the Unicode Text Segmentation standard described at http://www.unicode.org/reports/tr29/.
UnmarshalAndValidate is a convenience function to unmarshal an object and validate it.
UnmarshalAndValidateWithLimit unmarshals a struct with a limit on how many bytes can be read from the given reader.
Validate will run validation on the given object and return a set of field specific errors in the format: field <fieldname> <tag specific message> For example: "field 'flows' is required".

# Constants

UnavailableType is the pseudo content type we use for attachments that couldn't be fetched.

# Structs

TypedEnvelope can be mixed into envelopes that have a type field.

# Interfaces

Typed is an interface of objects that are marshalled as typed envelopes.

# Type aliases

Attachment is a media attachment on a message in the format <content-type>:<url>.
ErrorMessageFunc is the type for a function that can convert a field error to user friendly message.
ValidationErrors combines multiple validation errors as a single error.