common

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Alphanum ...
	Alphanum = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
	// Alpha ...
	Alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
	// Number ...
	Number = "0123456789"
)
View Source
const (
	// JsonEngine ...
	JsonEngine = CopyEngine("json")
	// GobEngine ...
	GobEngine = CopyEngine("gob")
	// GojayEngine ...
	GojayEngine = CopyEngine("gojay")
)
View Source
const DefaultPageSize int64 = 15

DefaultPageSize ...

Variables

This section is empty.

Functions

func ComputeHmac256

func ComputeHmac256() string

ComputeHmac256 ...

func Copy

func Copy(to, from interface{}, params ...CopyEngine) (err error)

Copy ...

func CopyBuffer

func CopyBuffer(src *bytes.Buffer) *bytes.Buffer

func CopyFile

func CopyFile(f, t string)

CopyFile ...

func Dir

func Dir() string

Dir ...

func FileExist

func FileExist(path string) (exist bool)

FileExist ...

func FormatSourceCode

func FormatSourceCode(filename string)

FormatSourceCode ...

func GetFileSize

func GetFileSize(name string) (int64, error)

GetFileSize ...

func GetFullPath

func GetFullPath(name string) string

GetFullPath ...

func GetLinkPath

func GetLinkPath(name string) string

GetLinkPath ...

func IsRunningInDockerContainer

func IsRunningInDockerContainer() bool

func ParseHmacToken

func ParseHmacToken(tokenString string, key []byte) (jwt.MapClaims, error)

ParseHmacToken ...

func RandInt

func RandInt(min int, max int) int

RandInt ...

func RandStr

func RandStr(strSize int, dictionary string) string

RandStr ...

func RandomString

func RandomString(l int) string

RandomString ...

func SetField

func SetField(obj interface{}, name string, value interface{}) error

func SetFields

func SetFields(obj interface{}, params map[string]interface{}) (err error)

func StaticPath

func StaticPath() string

StaticPath ...

func StoragePath

func StoragePath() string

StoragePath ...

func Strtomd5

func Strtomd5(s string) string

create md5 string

func TestMode

func TestMode() bool

TestMode ...

Types

type CopyEngine

type CopyEngine string

CopyEngine ...

type PageParams

type PageParams struct {
	Limit   int64  `json:"limit" validate:"required,gte=1,lte=1000"`
	Offset  int64  `json:"offset" validate:"required,gte=0,lte=1000"`
	Order   string `json:"order" validate:"required,oneof=created_at"`
	SortBy  string `json:"sort_by" validate:"required,oneof=desc asc"`
	PageReq int64
	SortReq string
}

PageParams ...

type SearchParams

type SearchParams struct {
	Query  string `json:"query" validate:"required,min=1,max;255"`
	Limit  int64  `json:"limit" validate:"required,gte=1,lte=1000"`
	Offset int64  `json:"offset" validate:"required,gte=0,lte=1000"`
}

SearchParams ...

Directories

Path Synopsis
astronomics

Jump to

Keyboard shortcuts

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