common

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TimeFormat = "2006-01-02 15:04:05"

TimeFormat time format

Functions

func CopyMap

func CopyMap(src, dest map[int64][]int64, gthan0 bool) (res map[int64][]int64)

CopyMap copy src to dest

func FilterBusinessName

func FilterBusinessName(s string) (res string)

FilterBusinessName .

func FilterChname

func FilterChname(s string) (res string)

FilterChname .

func FilterName

func FilterName(s string) (res string)

FilterName .

func ParseWaitTime

func ParseWaitTime(ut int64) string

ParseWaitTime 。

func Unique

func Unique(ids []int64, gthan0 bool) (res []int64)

Unique remove duplicated value from slice

func WaitTime

func WaitTime(ctime time.Time) string

WaitTime 计算等待时长

Types

type BaseOptions

type BaseOptions struct {
	BusinessID int64  `form:"business_id" json:"business_id"`
	NetID      int64  `form:"net_id" json:"net_id"`
	FlowID     int64  `form:"flow_id" json:"flow_id"`
	UID        int64  `form:"uid" json:"uid" submit:"int"`
	OID        string `form:"oid" json:"oid" submit:"string"`
	RID        int64  `form:"rid" json:"rid"`
	Role       int8   `form:"role" json:"role"`
	Debug      int8   `form:"debug" json:"debug"`
	Uname      string `form:"uname" json:"uname" submit:"string"`
}

BaseOptions 公共参数

type FormatTime

type FormatTime string

FormatTime .

func (*FormatTime) Scan

func (f *FormatTime) Scan(src interface{}) (err error)

Scan .

type GrayField

type GrayField struct {
	Name  string
	Value string
}

GrayField gray config for each business

type Group

type Group struct {
	ID        int64  `json:"group_id"`
	Name      string `json:"group_name"`
	Note      string `json:"group_note"`
	Tag       string `json:"group_tag"`
	FontColor string `json:"font_color"`
	BgColor   string `json:"bg_color"`
}

Group .

type IntTime

type IntTime int64

IntTime .

func (*IntTime) Scan

func (jt *IntTime) Scan(src interface{}) (err error)

Scan scan time.

func (IntTime) Time

func (jt IntTime) Time() time.Time

Time get time.

func (*IntTime) UnmarshalJSON

func (jt *IntTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implement Unmarshaler

func (IntTime) Value

func (jt IntTime) Value() (driver.Value, error)

Value get time value.

type Pager

type Pager struct {
	Total int `json:"total" reflect:"ignore"`
	Pn    int `form:"pn" default:"1" json:"pn" reflect:"ignore"`
	Ps    int `form:"ps" default:"20" json:"ps" reflect:"ignore"`
}

Pager .

Jump to

Keyboard shortcuts

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