# Functions
AsInt implies that the string exclusively contains an int.
AsIntOrNil returns an int or pointer.
AsNullInt implies that the pointer string should contain a number if not null.
AsUuid parses string as Uuid, and returns it or an empty uuid.
Base64DecodeAndUnmarshal decodes base64 and marshals.
An ordered list of fallback languages to use.
FormatInLocale formats timestamp in locale.
GenerateRandomSecureString generates a random secure string.
GetFeatureFlags returns flags for unleash.
GetOrSetContextWithLock gets or sets a value in the context with a lock.
GinContextToContextMiddleware injects the Gin context into the normal context to be later extracted.
GinCtx extract the GIN context from a normal context.
LargestTime returns the largest time of the alternatives.
LegacyLanguageCodeTo639_1 converts language codes used in the legacy system and the smil file to proper ISO 639-1 codes as used in our DB.
Lock returns a new stored lock.
LogError if it occurs.
MapAsInt is for usage in lo.Map.
MapAsIntegers is for usage in lo.Map.
MapWith function.
MapWithCtx performs a lo.Map but adds ctx as the 1st param to the map function and ignores index.
MarshalAndBase64Encode marshals to json and base64 encodes result.
MustCreateDBClient returns also a channel for async pinging.
MustCreateRedisClient throws a panic if redis is not reachable.
MustSetupTracing for Google Stack driver
It uses the following ENV vars to do some auto config: - GOOGLE_CLOUD_PROJECT - TRACE_SAMPLING_FREQUENCY - A number between 0.0 and 1.0 that determines how often requests should be traced.
NewCursor creates a new cursor.
Paginate a collection with specified parameters.
ParseAcceptLanguage HTTP header.
ParseCursor decodes from base64 and will unmarshal from json.
ParseItemCursor parses the base64 encoded cursor into a ItemCursor struct.
PointerArrayToArray converts an array of pointers to array.
PointerIntArrayToIntArray converts an array of int pointers to array of ints.
ReportFlagActivation reports flag activation as a header.
No description provided by the author
ShuffleSegmentedArray shuffles the segments and flattens to one array and tries to keep segments shuffled within segmentLength MinimumSegmentLength to make sure big batches of shorts still get prioritized more than the rest It adds random entries to the segments based on the randomFactor.
No description provided by the author
SmallestTime returns the smallest time of the alternatives.
TimestampFromString returns a validated time from a string.
ToItemCursor returns a cursor for the specified ids.
# Structs
Cursor contains basic cursor data.
DatabaseConfig contains configuration options for the database connection (Postgres).
FeatureFlag is a feature flag.
ItemCursor contains cursor data for pagination.
PaginationResult contains the result of the pagination and the effective first & offset.
RedisConfig contains configuration of the redis client.
SyncMap is a generic wrapper for sync.Map.
No description provided by the author
# Type aliases
FeatureFlags is a list of feature flags.