Documentation
¶
Overview ¶
Package util is a generated GoMock package.
Index ¶
- Constants
- Variables
- func AndWhere(wheres []string) string
- func ArrGet[T any](arr []T, idx []int) (ret []T)
- func ArrTo[T any](in []any) (ret []T, err error)
- func Avg[T int | float32 | float64](arr []T) (ret T)
- func Bind(ctx echo.Context, a any) error
- func CamelToSnake(s string) string
- func CamelToSnake2(s string) string
- func CheckHeaderEqual(ctx echo.Context, header, value string) bool
- func CloseToPlaceholderLimit(cnt, stride int) int
- func CollectBy[T any, R int | string](arr []T, fn func(T) R) (ret map[R]T)
- func ContainInt(sl []int, elem int) bool
- func Contains[T any](a T, b []T) bool
- func ContainsAll[T any](a, b []T) bool
- func ContainsAny[T any](a, b []T) bool
- func ContainsBy[T any](a T, b []T, fn func(a, b T) bool) bool
- func Create[T any](log zerolog.Logger, con sq.BaseRunner, table string, req T, returning []string, ...) (id int, err error)
- func CreateListPartition[T uint | int | string](partitionName string, parentName string, val T) string
- func CreateMany[T any](log zerolog.Logger, con sq.BaseRunner, table string, reqs []T, ...) (ids []int, err error)
- func CreateManySkip[T any](log zerolog.Logger, con sq.BaseRunner, table string, reqs []T, ...) (ids []int, err error)
- func CreateRangePartition[T uint | int | string](partitionName string, parentName string, from, to T) string
- func CreateSkip[T any](log zerolog.Logger, con sq.BaseRunner, table string, req T, ...) (id int, err error)
- func DBArrayValues[T any](array []T) string
- func DBJsonScan[T any](in any) (ret T, err error)
- func DateFromToday(daysOffset int, tz TZ) time.Time
- func DateFromTodayUTC(offset int) time.Time
- func DateUTC(y, m, d int) time.Time
- func DateUTCFromTime(t time.Time) time.Time
- func Dates(startDate, endDate time.Time) (ret []time.Time)
- func DatesBetweenIncl(a, b time.Time) (ret []time.Time)
- func DatesFromToday(start, end int, tz TZ) (ret []time.Time)
- func Dedup[T any](arr []T) (ret []T)
- func Delete(log zerolog.Logger, con sq.BaseRunner, table string, where []string) (err error)
- func EQx[T any](name string, v T) string
- func EitherRunner(tx *sqlx.Tx, db *sqlx.DB) squirrel.BaseRunner
- func EndOfDay(a time.Time) time.Time
- func EndOfMonth(a time.Time) time.Time
- func EndOfMonthOrToday(a time.Time) time.Time
- func EndOfMonthOrYesterday(a time.Time) time.Time
- func EndOfWeek(a time.Time) time.Time
- func EndOfWeekOrToday(a time.Time) time.Time
- func EndOfWeekOrYesterday(a time.Time) time.Time
- func ErrBadRequest(msg string) error
- func ErrForbidden(msg string) error
- func ErrInternal(msg string) error
- func ErrUnauthorized(msg string) error
- func Errs(err ...error) error
- func Except[T any](base, except []T) (ret []T)
- func ExistM(log zerolog.Logger, con *sqlx.DB, table string, where map[string]any) (ret bool, err error)
- func ExistS(log zerolog.Logger, con *sqlx.DB, table string, where []string) (bool, error)
- func ExtractTags(input any, tagName string, skip []string) (tags []string, vals []any)
- func Filter[T any](arr []T, filterFunc func(t T) bool) (ret []T)
- func FilterMap[T, R any](arr []T, fn func(t T) (R, bool)) (ret []R)
- func Filterm[K comparable, V any](m map[K]V, fn func(k K, v V) bool) (ret map[K]V)
- func FindAll[T any](arr []T, fn func(T) bool) (ret []T)
- func FindOne[T any](arr []T, fn func(T) bool) (ret T)
- func FindRootPath(rootPath string) string
- func FirstN[T any](arr []T, n int) (ret []T)
- func FlatMap[T, R any](arr []T, fn func(T) []R) (ret []R)
- func Flatten[T any](arr [][]T) (ret []T)
- func ForEach[T any](arr []T, sideEffectFunc func(t T))
- func FromAnys[T any](arr []any) []T
- func GetID[T int | string](ctx echo.Context) (t T, err error)
- func GetIDsByComma[T int | string](ctx echo.Context) (ret []T, err error)
- func GetM[T any](log zerolog.Logger, con *sqlx.DB, table string, where map[string]any) (ret T, err error)
- func GetManyM[T any](log zerolog.Logger, con *sqlx.DB, table string, where map[string]any, ...) (ret []T, err error)
- func GetManyS[T any](log zerolog.Logger, con *sqlx.DB, table string, where []string, ...) (ret []T, err error)
- func GetParam[T int | string](ctx echo.Context, name string) (t T, err error)
- func GetPayload[T any](ctx echo.Context) (t T, err error)
- func GetPayloads[T any](ctx echo.Context) (t []T, err error)
- func GetQuery[T int | string | bool](ctx echo.Context, name string) (t T, err error)
- func GetS[T any](log zerolog.Logger, con *sqlx.DB, table string, where []string) (ret T, err error)
- func HasIntersect[T any](base []T, another []T, emptyTrue bool) bool
- func Head[T any, K comparable](arr []T) (ret T)
- func HrBtw(t time.Time, min, max int) bool
- func INx[T any](name string, ins []T) string
- func In[T any](in T, space []T) bool
- func InBracket(s, left, right string) bool
- func IndexOf[T any](arr []T, equalFunc func(t T) bool) int
- func IndexesExcept[T any](sub, super []T) (ret []int)
- func IndexesOf[T any](sub, super []T) (ret []int, valid bool)
- func Intersect[T string | int | float64](a, b []T) (ret []T)
- func IsLastDayOfMonth(a time.Time) bool
- func IsStartOfMonth(a time.Time) bool
- func JoinByComma[T any](t []T) string
- func Last[T any](arr []T) (ret T)
- func LastDayOfTheMonth(date time.Time) time.Time
- func LastDayOfTheWeek(date time.Time) time.Time
- func LastMonth() time.Time
- func LastN[T any](arr []T, n int) (ret []T)
- func Latency(marker time.Time, kvs map[string]any)
- func ListFlex[T any](log zerolog.Logger, con *sqlx.DB, page Page, table string, ...) (ret []T, total int, err error)
- func ListM[T any](log zerolog.Logger, con *sqlx.DB, page Page, table string, ...) (ret []T, total int, err error)
- func ListS[T any](log zerolog.Logger, con *sqlx.DB, page Page, table string, ...) (ret []T, total int, err error)
- func Map[T, R any](arr []T, mapFunc func(t T) R) (ret []R)
- func MapE[T, R any](arr []T, mapFunc func(t T) (R, error)) (ret []R, err error)
- func MapIf[T, R any](arr []T, fn func(T) R, pred func(T) bool) (ret []R)
- func MapInPlace[T any](arr []T, mapFunc func(t T) T)
- func MapInPlaceE[T any](arr []T, mapFunc func(t T) (T, error)) (err error)
- func Mapm[K comparable, V, O any](m map[K]V, fn func(k K, v V) O) (ret []O)
- func Max[T int | float32 | float64](a, b T) T
- func MaxBy[T any, R int | float64](arr []T, maxBy func(t T) R) (max R)
- func MaxDayInMonth(month int) (day int)
- func MaxTime(a, b time.Time) time.Time
- func Migrate(db *sql.DB, dbName, migrationFile string) error
- func Min[T int | float32 | float64 | uint64](a, b T) T
- func MinTime(a, b time.Time) time.Time
- func MonthFromToday(monthOffset int) time.Time
- func MonthsFromToday(start, end int) (ret []time.Time)
- func MultipleJsonbSet(fieldName string, setMap map[string]any) (ret string)
- func MustTime(str string) time.Time
- func NewDB(dbName, url string, dcfg DBConfig) *sqlx.DB
- func NewDBRetry(dbName, url string, dcfg DBConfig, retries, dur int) *sqlx.DB
- func NewLogger(from string) zerolog.Logger
- func NewLoggerWithLevel(from string, minLevel zerolog.Level) zerolog.Logger
- func NewRand() *rand.Rand
- func NewTestDB(migrationPath string) *sqlx.DB
- func NotNullCount(ts ...interface{}) int
- func NowByTZ(tz TZ) time.Time
- func OkJSON(ctx echo.Context, data any) error
- func OneOf[T any](t T, arr []T) bool
- func OrDefault(value string, defaultValue string) string
- func Paginate[T any](arr []T, page Page) []T
- func Panic(err error)
- func ParseDBArray[T any](repr string) (ret []T, err error)
- func ParseJSONToStruct(src, dest any) error
- func ParseTime(s string) (ret time.Time, err error)
- func PartitionTruncate(t time.Time, timeLevel AggLevel) time.Time
- func PickRandom[T any](choices []T) (ret T)
- func PrepareIDPartition(con squirrel.BaseRunner, table, partitionSchema string, modulos int) error
- func Print(obj ...any)
- func RM(t time.Time) time.Time
- func RandInDayStr(dateStr string) time.Time
- func Random[T any](arr []T) T
- func RandomAlphabets(l int, lowerCase bool) string
- func RandomAlphanumeric(l int, lowerCase bool) string
- func RandomBool() bool
- func RandomFloat64(low float64, high float64) float64
- func RandomInt(low int, high int) int
- func RandomIntBetween(min, max int) int
- func RandomMomentInADay(t time.Time) time.Time
- func RandomString(low int, high int) (ret string)
- func RandomizeTime(t time.Time, parts string) time.Time
- func Range(start, end int) (ret []int)
- func ReadCSVFile(filename string) (map[string][]string, error)
- func Request[RESP any](method, url string, query, header map[string]string, data any, ...) (ret RESP, err error)
- func RequestCtx[RESP any](method, url string, query, header map[string]string, data any, ...) (ret RESP, err error)
- func RespCSV(ctx echo.Context, err error, csv, fileName string) error
- func RespJSON(ctx echo.Context, err error, payload any) error
- func RespNoContent(ctx echo.Context, err error) error
- func SameDate(a, b time.Time) bool
- func SelectStr(cols ...string) string
- func SetActive(log zerolog.Logger, con *sqlx.DB, table string, id int, active bool) (err error)
- func SetDelete(log zerolog.Logger, con *sqlx.DB, table string, id int, del bool) (err error)
- func SetDifference[T comparable](a, b map[T]bool) (ret map[T]bool)
- func SetIntersect[T comparable](a, b map[T]bool) (ret map[T]bool)
- func SetValues[T comparable](a map[T]bool) (ret []T)
- func SetupLocalStorage(newDB, baseDB, baseUrl, migrationFile string)
- func Shuffle[T any](arr []T)
- func SimpleFloatEqual(a, b, epsilon float64) bool
- func SliceEqual[T any](a, b []T) bool
- func SortAsStr[T any](arr []T) []T
- func SortTime(ts []time.Time)
- func StartOfDay(a time.Time) time.Time
- func StartOfMonth(a time.Time) time.Time
- func StartOfPrevMonth(a time.Time) time.Time
- func StartOfWeek(a time.Time) time.Time
- func StructDataType(s interface{}, tag string) []string
- func StructTags(s interface{}, tagName string, except []string) (ret []string)
- func Sum[T int | float32 | float64](arr []T) (ret T)
- func Tail[T any](arr []T) (ret T)
- func TimeByTz(t time.Time, tz TZ) time.Time
- func TimeEqual(a, b time.Time) bool
- func TimeIncr(t time.Time, aggLevel AggLevel) (time.Time, error)
- func TimePointsFiller(ids []string, pts []time.Time) string
- func Timestamp(y, m, d, h, min, s int) time.Time
- func To[T any](in any) (ret T, err error)
- func ToAnys[T any](arr []T) []any
- func ToDate(t time.Time) time.Time
- func ToDateUTC(t time.Time) time.Time
- func ToFloat64(x any) (val float64, err error)
- func ToMap[T comparable](arr []T) (ret map[T]bool)
- func ToMid(handler echo.HandlerFunc) echo.MiddlewareFunc
- func ToPqStrArray[T any](arr []T) (ret pq.StringArray)
- func ToStr[T any](a T) string
- func Truncate(t time.Time, timeLevel AggLevel) time.Time
- func Unique[T any](arr []T) (ret []T)
- func UniqueBy[T any](arr []T, fn func(T) string) (ret []T)
- func UniqueOf[T, R any](arr []T, fn func(T) R) (ret []R)
- func UnmarshalResp[T any](resp *http.Response) (ret T, err error)
- func UpdateClause(headers, pks []string, mergeStrategy map[string]string) string
- func UpdateM(log zerolog.Logger, con sq.BaseRunner, table string, where map[string]any, ...) (err error)
- func UpdateMore(log zerolog.Logger, con sq.BaseRunner, table string, ids []int, ...) (err error)
- func UpdateS(log zerolog.Logger, con sq.BaseRunner, table string, where []string, ...) (err error)
- func UpdateWithID(log zerolog.Logger, con sq.BaseRunner, table string, id int, ...) (err error)
- func UpsertMany[T any](log zerolog.Logger, con sq.BaseRunner, table string, pks []string, tag string, ...) (err error)
- func UpsertQuery(cols []string) string
- func ValueList[T any](arr []T, label string, withOrder bool) string
- func ValueListTable[T any](arr []T, label string) string
- func WithTimeout(dur time.Duration) (context.Context, context.CancelFunc)
- func YesterdayByTZ(tz TZ) time.Time
- func YesterdayOf(t time.Time) time.Time
- type AggLevel
- type Checkable
- type DBConfig
- type Decimal
- type Err
- type ExceptFn
- type FirebaseAuth
- type FirebaseJwtParser
- type GoogleJwtParser
- type InsertHelper
- type JwtParser
- type MicroSoftJwtParser
- type MockJwtParser
- type MockJwtParserMockRecorder
- type NullFloat64
- type Obj
- type Objs
- type Page
- type PaginatedResult
- type PartitionFunc
- type PostgresConfig
- type RedisConfig
- type ReqKit
- type RequestCfg
- type StrMap
- type TZ
- type TsPoint
- type TsPoints
- type TsRange
- type UserPayload
Constants ¶
const MicrosoftJwksUrl = "https://login.microsoftonline.com/common/discovery/v2.0/keys"
const PostgresPlaceholderLimit = 65535
Variables ¶
var CustomErrHandler = func(e *echo.Echo) func(err error, c echo.Context) { return func(err error, c echo.Context) { if e, ok := err.(Err); ok { e1 := c.JSON(e.Code, map[string]any{"message": e.Msg, "data": fmt.Sprintf("%+v", e.Data)}) if e1 != nil { _ = c.JSON(http.StatusInternalServerError, "error marshal error json: "+e1.Error()) } return } e.DefaultHTTPErrorHandler(err, c) } }
var DBTimestamptzFormat = "2006-01-02 15:04:05Z07"
var DateFormat = time.DateOnly
var DefaultLoggingLevel = zerolog.InfoLevel
var (
ErrNotBytes = errors.New("error not bytes")
)
var LOG = NewLogger("default")
var NoPagination = Page{Off: true}
var Psql = squirrel.StatementBuilder.PlaceholderFormat(squirrel.Dollar)
var TimestamptzFormat = time.RFC3339
var Validator = validator.New()
Functions ¶
func CamelToSnake ¶
func CamelToSnake2 ¶ added in v0.4.2
assume first letter is upper
func CheckHeaderEqual ¶
func CloseToPlaceholderLimit ¶
func ContainInt ¶
func Contains ¶
check if b has at least one of element in a equality is simply by converting the type to string
func ContainsAny ¶
whether at least one of the elements in a is present in b
func ContainsBy ¶
func Create ¶ added in v0.1.8
func Create[T any](log zerolog.Logger, con sq.BaseRunner, table string, req T, returning []string, partitionFunc PartitionFunc) (id int, err error)
func CreateListPartition ¶ added in v0.1.20
func CreateMany ¶ added in v0.1.8
func CreateMany[T any](log zerolog.Logger, con sq.BaseRunner, table string, reqs []T, returning []string, partitionFunc PartitionFunc) (ids []int, err error)
func CreateManySkip ¶ added in v0.1.24
func CreateManySkip[T any](log zerolog.Logger, con sq.BaseRunner, table string, reqs []T, returning, skipping []string, partitionFunc PartitionFunc) (ids []int, err error)
func CreateRangePartition ¶ added in v0.1.20
func CreateRangePartition[T uint | int | string](partitionName string, parentName string, from, to T) string
there are three types of partition in postgres - range - list - hash
func CreateSkip ¶ added in v0.1.24
func CreateSkip[T any](log zerolog.Logger, con sq.BaseRunner, table string, req T, returning, skipping []string, partitionFunc PartitionFunc) (id int, err error)
func DBArrayValues ¶
func DBJsonScan ¶ added in v0.2.7
func DateFromTodayUTC ¶
func EitherRunner ¶
func EndOfMonthOrToday ¶ added in v0.3.21
end of month
func ErrBadRequest ¶
func ErrForbidden ¶
func ErrInternal ¶
func ErrUnauthorized ¶
func Except ¶
func Except[T any](base, except []T) (ret []T)
remove all items find in `except` from `base`, naive implementation with string equality
func ExtractTags ¶
func Filterm ¶
func Filterm[K comparable, V any](m map[K]V, fn func(k K, v V) bool) (ret map[K]V)
func FindRootPath ¶ added in v0.3.2
func GetIDsByComma ¶ added in v0.1.5
func GetPayload ¶
GetPayload takes care of marshaling the payload from request 1) if the payload was never read before, then it read the payload, and it saves within the context 2) if the payload has already been read, then it read directly from the context can only work if the http verb is NOT [GET DELETE HEAD] for payload in body
func GetPayloads ¶
func HasIntersect ¶
HasIntersect check if another slices has at least one element in the base slice equality check is done by converting element to string
func Head ¶
func Head[T any, K comparable](arr []T) (ret T)
func IndexesExcept ¶
func IsLastDayOfMonth ¶
func IsStartOfMonth ¶
func JoinByComma ¶
func MapInPlace ¶
func MapInPlace[T any](arr []T, mapFunc func(t T) T)
func MapInPlaceE ¶
func Mapm ¶
func Mapm[K comparable, V, O any](m map[K]V, fn func(k K, v V) O) (ret []O)
func MaxDayInMonth ¶
func MonthFromToday ¶
func MonthsFromToday ¶
func NewDBRetry ¶ added in v0.3.31
func NewLoggerWithLevel ¶
func NewTestDB ¶ added in v0.1.9
base db name and access is hardcoded, and it's linked with Storage-Up in Makefile
func NotNullCount ¶
func NotNullCount(ts ...interface{}) int
func ParseDBArray ¶
ParseDBArray supported type is based on the needed usecases (number, time, etc)
func ParseJSONToStruct ¶
func PickRandom ¶
func PickRandom[T any](choices []T) (ret T)
func PrepareIDPartition ¶ added in v0.3.6
func PrepareIDPartition(con squirrel.BaseRunner, table, partitionSchema string, modulos int) error
it assume certain structure of the table and index name
func RandInDayStr ¶
func RandomAlphabets ¶
func RandomAlphanumeric ¶
func RandomBool ¶
func RandomBool() bool
func RandomFloat64 ¶
func RandomIntBetween ¶
func RandomString ¶
func RequestCtx ¶ added in v0.2.1
func RespNoContent ¶
func SetDifference ¶
func SetDifference[T comparable](a, b map[T]bool) (ret map[T]bool)
func SetIntersect ¶
func SetIntersect[T comparable](a, b map[T]bool) (ret map[T]bool)
func SetValues ¶
func SetValues[T comparable](a map[T]bool) (ret []T)
func SetupLocalStorage ¶ added in v0.1.8
func SetupLocalStorage(newDB, baseDB, baseUrl, migrationFile string)
skip migration if migration file path is empty
func SimpleFloatEqual ¶
can use relative tolerance, but for now absolute tolerance is sufficient
func SliceEqual ¶
func StructDataType ¶
func StructTags ¶
func ToMap ¶
func ToMap[T comparable](arr []T) (ret map[T]bool)
func ToMid ¶
func ToMid(handler echo.HandlerFunc) echo.MiddlewareFunc
ToMid means ToMIddleware convert HandlerFunc to one type of middleware, next() is at the bottom
func ToPqStrArray ¶
func ToPqStrArray[T any](arr []T) (ret pq.StringArray)
func UnmarshalResp ¶ added in v0.3.18
func UpdateClause ¶
func UpdateMore ¶ added in v0.1.8
func UpdateWithID ¶ added in v0.1.8
func UpsertMany ¶ added in v0.1.13
func UpsertQuery ¶
func ValueListTable ¶
func WithTimeout ¶ added in v0.1.23
func YesterdayByTZ ¶
Types ¶
type DBConfig ¶ added in v0.1.8
type DBConfig struct { MaxOpenConn int MaxIdelConn int ConnMaxIdleTime time.Duration ConnMaxLifetime time.Duration }
func (*DBConfig) SetDefault ¶ added in v0.1.8
func (d *DBConfig) SetDefault()
type Decimal ¶ added in v0.1.3
func NewDecimal ¶ added in v0.1.3
func NewDecimalF ¶ added in v0.1.3
func (Decimal) MarshalJSON ¶ added in v0.1.3
func (*Decimal) UnmarshalJSON ¶ added in v0.1.3
type Err ¶
func ErrNotFound ¶ added in v0.1.4
type ExceptFn ¶ added in v0.1.18
type ExceptFn func(token string) *UserPayload
type FirebaseAuth ¶ added in v0.3.4
type FirebaseAuth struct {
CredentialJSON string `yaml:"credential_json" json:"credential_json"`
}
func (FirebaseAuth) GetFirebaseClient ¶ added in v0.3.4
func (c FirebaseAuth) GetFirebaseClient() *auth.Client
func (FirebaseAuth) GetFirebaseMsgClient ¶ added in v0.3.4
func (c FirebaseAuth) GetFirebaseMsgClient() *messaging.Client
func (FirebaseAuth) InitFirebase ¶ added in v0.3.4
func (c FirebaseAuth) InitFirebase()
type FirebaseJwtParser ¶ added in v0.1.16
type FirebaseJwtParser struct {
// contains filtered or unexported fields
}
---------------- firebase -------------------
func NewFirebaseJwtParser ¶ added in v0.1.16
func NewFirebaseJwtParser(jsonCredential string, exceptFn ExceptFn) FirebaseJwtParser
func (FirebaseJwtParser) TokenToPayload ¶ added in v0.1.16
func (g FirebaseJwtParser) TokenToPayload(token string) (ret UserPayload, err error)
TokenToUsername implements JwtParser
type GoogleJwtParser ¶ added in v0.1.16
type GoogleJwtParser struct { ClientID string // contains filtered or unexported fields }
---------------- google -------------------
func NewGoogleJwtParser ¶ added in v0.1.16
func NewGoogleJwtParser(clientID string, exceptFn ExceptFn) GoogleJwtParser
func (GoogleJwtParser) TokenToPayload ¶ added in v0.1.16
func (g GoogleJwtParser) TokenToPayload(token string) (ret UserPayload, err error)
TokenToUsername implements JwtParser
type InsertHelper ¶
type InsertHelper struct {
// contains filtered or unexported fields
}
func NewInsertHelper ¶
func (*InsertHelper) Add ¶
func (ih *InsertHelper) Add(args []any) (err error)
func (*InsertHelper) Finish ¶
func (ih *InsertHelper) Finish() (err error)
type JwtParser ¶ added in v0.1.16
type JwtParser interface {
TokenToPayload(token string) (payload UserPayload, err error)
}
type MicroSoftJwtParser ¶ added in v0.3.8
type MicroSoftJwtParser struct {
// contains filtered or unexported fields
}
---------------- ms -------------------
func NewMicrosfotJwtParser ¶ added in v0.3.8
func NewMicrosfotJwtParser(exceptFn ExceptFn) MicroSoftJwtParser
func (MicroSoftJwtParser) TokenToPayload ¶ added in v0.3.8
func (g MicroSoftJwtParser) TokenToPayload(token string) (ret UserPayload, err error)
TokenToUsername implements JwtParser
type MockJwtParser ¶ added in v0.1.19
type MockJwtParser struct {
// contains filtered or unexported fields
}
MockJwtParser is a mock of JwtParser interface.
func NewMockJwtParser ¶ added in v0.1.19
func NewMockJwtParser(ctrl *gomock.Controller) *MockJwtParser
NewMockJwtParser creates a new mock instance.
func (*MockJwtParser) EXPECT ¶ added in v0.1.19
func (m *MockJwtParser) EXPECT() *MockJwtParserMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockJwtParser) TokenToPayload ¶ added in v0.1.19
func (m *MockJwtParser) TokenToPayload(arg0 string) (UserPayload, error)
TokenToPayload mocks base method.
type MockJwtParserMockRecorder ¶ added in v0.1.19
type MockJwtParserMockRecorder struct {
// contains filtered or unexported fields
}
MockJwtParserMockRecorder is the mock recorder for MockJwtParser.
func (*MockJwtParserMockRecorder) TokenToPayload ¶ added in v0.1.19
func (mr *MockJwtParserMockRecorder) TokenToPayload(arg0 interface{}) *gomock.Call
TokenToPayload indicates an expected call of TokenToPayload.
type NullFloat64 ¶ added in v0.3.1
func (NullFloat64) MarshalJSON ¶ added in v0.3.1
func (o NullFloat64) MarshalJSON() ([]byte, error)
func (*NullFloat64) Scan ¶ added in v0.3.1
func (o *NullFloat64) Scan(v any) error
type Page ¶
func GetPagination ¶
type PaginatedResult ¶
type PartitionFunc ¶ added in v0.1.8
type PartitionFunc func(runner sq.BaseRunner, table string) error
type PostgresConfig ¶ added in v0.3.3
type PostgresConfig struct { Username string `yaml:"username"` Password string `yaml:"password"` DatabaseName string `yaml:"database_name"` Host string `yaml:"host"` DatabaseSSLMode string `yaml:"database_ssl_mode"` Port int `yaml:"port"` }
func (PostgresConfig) GetLocalBaseURL ¶ added in v0.3.3
func (p PostgresConfig) GetLocalBaseURL() string
func (PostgresConfig) GetURL ¶ added in v0.3.3
func (p PostgresConfig) GetURL() string
type RedisConfig ¶ added in v0.3.3
type ReqKit ¶ added in v0.2.3
type ReqKit struct { Req *http.Request Resp *httptest.ResponseRecorder Ctx echo.Context }
func NewHttpTestKit ¶
func NewHttpTestKit(engine *echo.Echo, r RequestCfg) ReqKit
type RequestCfg ¶
type TsRange ¶
type UserPayload ¶ added in v0.1.16
type UserPayload struct { Username string Email string Name string FirstName string LastName string }
func ParseJwtToken ¶ added in v0.3.12
func ParseJwtToken(jwtToken string, jwtParsers ...JwtParser) (ret UserPayload, err error)