utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileIsTooLarge = errors.InvalidArgumentErrorf("file exceeds maximum file size")
View Source
var ErrInvalidUpdatedAt = errors.InvalidArgumentErrorf("invalid updated at timestamp")

Functions

func GetData

func GetData(stream interface {
	Receive() ([]byte, error)
}, maxSize int,
) ([]byte, error)

func GetExponentialBackoff

func GetExponentialBackoff(backoff float64, factor float64) time.Duration

func GetIdentifierFromIdentifier

func GetIdentifierFromIdentifier(userID uuid.UUID) (string, string)

func Retry

func Retry(amount int, dur time.Duration, x func() error) error

func UserIdentifier

func UserIdentifier(u *user.User) string

func UserName

func UserName(u *user.User) string

func ValidateEmail

func ValidateEmail(email string) error

func ValidatePassword

func ValidatePassword(password string) error

func ValidatePhone

func ValidatePhone(phone string) error

Types

type DataReceive

type DataReceive func() ([]byte, error)

func (DataReceive) Receive

func (d DataReceive) Receive() ([]byte, error)

Jump to

Keyboard shortcuts

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