util

package
v0.0.0-...-d98c8e0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateFormatRFC3339 = time.RFC3339
)

Variables

View Source
var Command = map[string]string{
	"create_question": "create_question",
	"update_question": "update_question",
	"delete_question": "delete_question",
	"question":        "question",
	"questions":       "questions",
	"answer_question": "answer_question",
}
View Source
var Operator = map[string]string{
	"gt":      ">",
	"lt":      "<",
	"eq":      "=",
	"ne":      "!=",
	"gte":     ">=",
	"lte":     "<=",
	"like":    "like",
	"in":      "in",
	"notin":   "in",
	"null":    "is null",
	"notnull": "is not null",
}

Operator string transalation

Functions

func EncodeBase64

func EncodeBase64(s string) string

func FormatDateToRFC3339

func FormatDateToRFC3339(t time.Time) string

func GetRedisKey

func GetRedisKey(domain, id string) string

func PrintHelp

func PrintHelp()

func StringToInt

func StringToInt(s string) int

func StringToInt64

func StringToInt64(s string) int64

Types

type Query

type Query struct {
	Sort   string `json:"sort"`
	Filter map[string]interface{}
}

Query struct binder for default query param

func NewQuery

func NewQuery(sort string, filter map[string]interface{}) *Query

NewQuery initiate query

func (*Query) Order

func (q *Query) Order() string

Order generate string ordering query statement

func (*Query) Where

func (q *Query) Where() (string, []interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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