Categorygithub.com/Alibay/go-kit
modulepackage
0.0.0-202411202249
Repository: https://github.com/alibay/go-kit.git
Documentation: pkg.go.dev

# README

= kit: a common purpose library Черновик, v1.0 :toc: :toc-title: Content

== Build

$ go build ./...

== Running tests

unit tests

$ go test -count=1 ./...

integration tests

$ go test -count=1 -tags integration ./...

== Local development

required utils: |=== | Util | Version |golang | 1.20+ |make | 4.2.1 |protoc| 3.17.3 |===

Major commands for the local development:


make artifacts

make build

make test

make test-integration

Additional commands see Makefile

== CI/CD

# Packages

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

# Functions

Await allows awaiting some state by periodically hitting fn unless either it returns true or error or timeout It returns nil when fn results true.
No description provided by the author
No description provided by the author
No description provided by the author
ConvertSlice is a generic function to convert one slice to another with help of converter func.
No description provided by the author
Date returns a date of a passed timestamp without time.
No description provided by the author
Diff properly calculates difference between two dates in year, month etc.
No description provided by the author
No description provided by the author
No description provided by the author
ExtractUrlExtension extract extension from url.
No description provided by the author
First returns selected by condition item or default.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GenerateInternalAccessToken generates token for internal communications between services.
GenerateTimeSeries takes period of time and generates slice of timestamps with the given period step.
GenJwtToken generates a new JWT token.
GetDefault get default value for type.
No description provided by the author
GroupBy groups by slice by the key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IsAppErr checks if error interface is asserted to *AppError if true, it returns *AppError.
IsCoordinateValid checks if coordinate valid.
IsEmailValid checks email format.
IsEmpty gets whether the specified object is considered empty or not.
IsIpV4Valid checks ip v4 format.
IsIpV6Valid checks ip v6 format.
IsPhoneValid checks phone format (with country code without special characters).
IsRussianPhoneValid checks Russian phone format (with country code without special characters).
No description provided by the author
IsTimeZoneIANA returns true if provided valid IANA time zone.
No description provided by the author
JsonDecode decodes type from json bytes.
JsonEncode encodes type to json bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MaxTime returns maximum time of the provided slice.
Millis is a convenience method to get milliseconds since epoch for provided HourMinTime.
No description provided by the author
MinTime returns minimum time of the provided slice.
No description provided by the author
NanoId generates random string.
NewAppErrBuilder creates a new AppErrBuilder and default AppError object.
NewAppError creates a new AppError and returns error interface.
No description provided by the author
No description provided by the author
NewId generates UUID.
No description provided by the author
NewRandString generates a unique string.
No description provided by the author
No description provided by the author
No description provided by the author
Nil returns nil UUID.
Now is the current time.
NowDate returns current date without time.
NowMillis is the current time in millis.
NowNanos is the current time in UNIX NANO format.
No description provided by the author
NumCode generates random number code with the given size.
No description provided by the author
ParseDateAny parses multiple formats of dates.
No description provided by the author
No description provided by the author
ParseInternalAccessToken parses an internal token.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UUID generates UUID.
ValidateUUIDs check UUID format nad return error if at least one UUID isn't in a correct format.
VerifyJwtToken verifies a JWT token.

# Constants

No description provided by the author
No description provided by the author
DebugLevel level.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrorLevel level.
No description provided by the author
No description provided by the author
No description provided by the author
FatalLevel level.
No description provided by the author
No description provided by the author
No description provided by the author
InfoLevel level.
No description provided by the author
PanicLevel level, highest level of severity.
No description provided by the author
No description provided by the author
No description provided by the author
TraceLevel level.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WarnLevel level.
No description provided by the author

# Variables

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

# Structs

AppError specifies application error object.
No description provided by the author
Formatter - logrus formatter, implements logrus.Formatter.
No description provided by the author
No description provided by the author
HourMinTime - time (hour:min) representation in format 15:04.
JwtRequest request to generate a new jwt token.
LogConfig represents logging configuration.
No description provided by the author
PagingRequest paging request.
PagingRequestG generic paging request.
PagingResponse paging response.
PagingResponseG generic paging response.
No description provided by the author
SortRequest request to sort data.
No description provided by the author
TimePeriod represents period of time.
No description provided by the author
WaitGroup wait group with duration timeout.

# Interfaces

Adapter common interface for adapters.
AdapterListener common interface for adapters with listeners.
AppErrBuilder allows building AppError object.
CLogger provides structured logging abilities !!!! Not thread safe.
ErrorHook allows specifying a hook for all logged errors.
PageReader is a generic reader allowing read from remote repository.
Searchable interface provides a search abilities.

# Type aliases

No description provided by the author
DayOfWeek specifies days of week.
No description provided by the author
KV key value type.
Strings represents slice of strings.
TimeRange represents time interval in format [15:00, 18:00].