common

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REFRESH_TOKEN_KEY   = "refresh_token"
	PASSWORD_MIN_LENGTH = 8
	PASSWORD_MAX_LENGTH = 20

	ContextUserKey ctxKey = "user"
)

Variables

View Source
var (
	PhoneRegexp = regexp.MustCompile(`[a-zA-Z\s-\(\)\,\:]`)
)

Functions

func ConvertBoolToStr

func ConvertBoolToStr(v bool, associated map[bool]string) string

func ConvertToInt

func ConvertToInt(data interface{}) (int, error)

ConvertToInt конвертируем интерфейс в int

func ConvertToString

func ConvertToString(data interface{}) (res string)

ConvertToString конвертируем interface{} в строку

func Exists

func Exists(name string) (bool, error)

func GetRefreshToken

func GetRefreshToken(r *http.Request) (string, error)

func InterfaceSlice

func InterfaceSlice(slice interface{}) []interface{}

func IsDigitsOnly

func IsDigitsOnly(s string) bool

func PhoneConverter

func PhoneConverter(phone string) string

Types

type RefreshToken

type RefreshToken struct {
	RefreshToken string `json:"refreshToken" serializer:"required"`
}

Jump to

Keyboard shortcuts

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