Categorygithub.com/wego/pkg/common
modulepackage
0.1.17
Repository: https://github.com/wego/pkg.git
Documentation: pkg.go.dev

# Functions

CurrentLocalTime returns current date time in local timezone.
CurrentUnixTimestamp returns current Unix timestamp (seconds).
CurrentUTCTime returns current date time in UTC.
CurrentUTCTimeRef returns current date time reference in UTC.
GenerateCardNumberFromBin will generate credit card number based on bin number and the card number length.
GetBasic gets basic from the context with key.
GetBasics gets basics from the context if any.
GetExtra gets Extra from the context with key.
GetExtras gets extras from the context if any.
GetStatsD gets statsD client from the context if any.
GetString gets string from a context by ContextKey.
SetBasic returns a copy of parent context with basic key value added into it.
SetBasics returns a copy of parent context with basics added into it.
SetExtra returns a copy of parent context with Extra key value added into it.
SetExtras returns a copy of parent context with extras added into it.
SetStatsD returns a copy of parent context with statsD client added into it.
TimeChanged check if new time changed from the base, return the changed flag and time value.
ValidateCardNumber will check the credit card's number against the Luhn algorithm.

# Constants

common constants.
common constants.
date time string formats.
date time string formats.
date time string formats.
common constants.
date time string formats.

# Structs

DMutex a simple distributed mutex for lock with keys.

# Interfaces

DistributedLocker a distributed lock type.

# Type aliases

Basics are basics information to be added into context.
ContextKey is key to be used to store values to context.
Date : custom date in format yyyy-MM-dd.
Extras are extra information to be added into context.
UnLocker unlock function.