wst

package
v1.5.47-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegexpIdEntire = regexp.MustCompile("^([0-9a-f]{24})$")
View Source
var RegexpIpStart = regexp.MustCompile("^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}")

Functions

func DashedCase

func DashedCase(st string) string

func IsAnyDate added in v1.2.97

func IsAnyDate(data string) bool

func IsDate1 added in v1.2.97

func IsDate1(data string) bool

func IsDate2 added in v1.2.97

func IsDate2(data string) bool

func IsDate3 added in v1.2.97

func IsDate3(data string) bool

func IsDate4 added in v1.2.97

func IsDate4(data string) bool

func LoadFile

func LoadFile(filePath string, out interface{}) error

func ParseDate added in v1.2.97

func ParseDate(data string) (time.Time, error)

func Transform added in v1.2.26

func Transform(in interface{}, out interface{}) error

High-cost operation...

Types

type A added in v1.2.36

type A []M

func AFromGenericSlice added in v1.2.93

func AFromGenericSlice(in *[]interface{}) *A

AFromGenericSlice converts a generic slice of M to a *A This is used to convert the result of a query to a *A Returns nil if in is nil

func AFromPrimitiveSlice added in v1.2.93

func AFromPrimitiveSlice(in *primitive.A) *A

AFromPrimitiveSlice converts a primitive slice of primivite.M or M to a *A This is used to convert the result of a query to a *A Returns nil if in is nil

type Filter added in v1.2.37

type Filter struct {
	Where   *Where   `json:"where"`
	Include *Include `json:"include"`
	Order   *Order   `json:"order"`
	Skip    int64    `json:"skip"`
	Limit   int64    `json:"limit"`
}

type IApp

type IApp struct {
	Debug          bool
	SwaggerPaths   func() *map[string]M
	FindModel      func(modelName string) (interface{}, error)
	FindDatasource func(datasource string) (interface{}, error)
	JwtSecretKey   []byte
	Viper          *viper.Viper
}

type Include added in v1.2.37

type Include []IncludeItem

type IncludeItem added in v1.2.73

type IncludeItem struct {
	Relation string  `json:"relation"`
	Scope    *Filter `json:"scope"`
}

type M added in v1.2.36

type M map[string]interface{}
var (
	NilMap          M = M{"<wst.NilMap>": 1}
	DashedCaseRegex   = regexp.MustCompile("([A-Z])")
)

func CopyMap

func CopyMap(src M) M

func (M) GetM added in v1.2.76

func (m M) GetM(key string) M

func (M) GetString added in v1.2.76

func (m M) GetString(key string) string

type OperationName added in v1.5.40

type OperationName string
const (
	OperationNameFindById         OperationName = "findById"
	OperationNameFindMany         OperationName = "findMany"
	OperationNameCount            OperationName = "count"
	OperationNameCreate           OperationName = "create"
	OperationNameUpdateAttributes OperationName = "updateAttributes"
)

type Order added in v1.2.37

type Order []string

type Stats added in v1.5.29

type Stats struct {
	BuildsByModel map[string]map[string]float64
}

type WeStackError added in v1.4.1

type WeStackError struct {
	FiberError *fiber.Error
	Code       string
	Details    fiber.Map
	Name       string
	// contains filtered or unexported fields
}

func CreateError added in v1.4.1

func CreateError(fiberError *fiber.Error, code string, details fiber.Map, name string) *WeStackError

func (*WeStackError) Error added in v1.4.1

func (err *WeStackError) Error() string

type Where added in v1.2.37

type Where M

Jump to

Keyboard shortcuts

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