common

package
v0.0.0-...-0f1690e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertClientSideError

func AssertClientSideError(t *testing.T, err error)

func AssertValidationError

func AssertValidationError(t *testing.T, err error)

func ClearTestDB

func ClearTestDB(ctx context.Context, t *testing.T)

func ClearTestRedis

func ClearTestRedis(ctx context.Context)

func GetTestAccountsCollection

func GetTestAccountsCollection() *mongo.Collection

func GetTestDBClient

func GetTestDBClient() *mongo.Client

func GetTestRedisClient

func GetTestRedisClient() *redis.Client

func GetTestSessionsCollection

func GetTestSessionsCollection() *mongo.Collection

func NewClientSideError

func NewClientSideError(title string) error

func NewServerSideError

func NewServerSideError(title string) error

func NewTooManyRequestsError

func NewTooManyRequestsError(title string) error

func NewValidationError

func NewValidationError(title string, errors []string) error

func RandomIntegerSecure

func RandomIntegerSecure(inclusiveStart, inclusiveEnd int) (int, error)

RandomIntegerSecure the returnable range is [inclusiveStart;inclusiveEnd]

func ReverseString

func ReverseString(s string) string

Types

type ClientSideError

type ClientSideError struct {
	Title string `json:"title"`
}

func (*ClientSideError) Error

func (cse *ClientSideError) Error() string

func (*ClientSideError) Is

func (cse *ClientSideError) Is(tgt error) bool

type ServerSideError

type ServerSideError struct {
	Title string `json:"title"`
}

func (*ServerSideError) Error

func (sse *ServerSideError) Error() string

type TooManyRequestsError

type TooManyRequestsError struct {
	Title string `json:"title"`
}

func (*TooManyRequestsError) Error

func (tmre *TooManyRequestsError) Error() string

type ValidationError

type ValidationError struct {
	Title  string   `json:"title"`
	Errors []string `json:"errors"`
}

func (*ValidationError) Error

func (ve *ValidationError) Error() string

Directories

Path Synopsis
Package rest provides primitives to interact with the openapi HTTP API.
Package rest provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL