Documentation ¶
Index ¶
- Constants
- Variables
- func A()
- func AddDate(ts int64, years, months, days int) int64
- func ApiPath(subpath string) string
- func ConsoleApiPath(subpath string) string
- func ForceToInt64(s string) int64
- func GetCurrYearMonth() (int, time.Time)
- func GetDatePart(t *time.Time) time.Time
- func GetMs(t *time.Time) int64
- func GetPartOfInt64Slice(theSlice []int64, fromKey int, size int) []int64
- func GetPartOfStringSlice(theSlice []string, fromKey int, size int) []string
- func GetPrevYearMonth() (int, time.Time)
- func GetRandomByMinMax(min, max int) int
- func GetUserAgent(req *http.Request) string
- func GetYearMonth(t time.Time) int
- func Getwd() string
- func HasFormValue(req *http.Request, key string) bool
- func Int64SliceToString(s []int64) []string
- func IntSliceToString(s []int) []string
- func InternalApiPath(subpath string) string
- func IsApiPath(path string) bool
- func IsDate(s string) bool
- func IsDirExists(dir string) bool
- func IsDuplicateError(err error) bool
- func IsDuplicateError2(err error) bool
- func IsEmail(s string) bool
- func IsEmpty(s string) bool
- func IsExists(array []int, key int) bool
- func IsExistsString(array []string, key string) bool
- func IsFileExisted(thepath string) bool
- func IsMobile(s string) bool
- func IsNotEmpty(s string) bool
- func IsPublicIP(ip string) bool
- func IsRegularOrNotExists(thepath string) bool
- func Md5(src string) string
- func MergeValues(src, dst url.Values)
- func MonthToRange(month int) (begin, end time.Time, err error)
- func NewUUID() *uuid.UUID
- func NowDate() time.Time
- func NowDateString() string
- func NowDateTimeString() string
- func NowMs() int64
- func ParseAddress(remoteAddr string) string
- func ParseInt(s string, defaultValue int64) int64
- func ParseScreen(screen string) (long int, short int)
- func RandHex(n int) string
- func RandNumberString(length int) string
- func RandString(bits int) string
- func ReadJson(reader io.ReadCloser, data interface{}) error
- func RenderHtml(r render.Render, view string, data interface{})
- func RepeatString(times int, s, split string) string
- func SplitToIntSlice(s string) []int64
- func String2Date(s string, loc *time.Location) *time.Time
- func String2DateTime(s string, loc *time.Location) *time.Time
- func StringS2Interface(slice []string) []interface{}
- func StringSliceToInt(s []string) []int
- func StringSliceToInt64(s []string) []int64
- func TimestampToTime(ts int64) time.Time
- func ToTimestamp(t *time.Time) int64
- func Today() time.Time
- func UniqueId() string
- func UniqueInt64Slice(values []int64) []int64
- func UniqueIntSlice(values []int) []int
- func WriteUploadFile(fileheaer *multipart.FileHeader, dst string) error
- func Yesterday() time.Time
- type Buffer
- type PagingParams
Constants ¶
View Source
const ApiPrefix = ""
View Source
const ConsoleApiPrefix = "/api/c"
View Source
const InternalApiPrefix = "/api/i"
Variables ¶
View Source
var Location *time.Location = time.Local
Functions ¶
func ConsoleApiPath ¶
func GetCurrYearMonth ¶
func GetPartOfInt64Slice ¶
func GetPartOfStringSlice ¶
func GetUserAgent ¶
func GetYearMonth ¶
func Int64SliceToString ¶
func IntSliceToString ¶
func InternalApiPath ¶
func IsDirExists ¶
func IsDuplicateError ¶
func IsDuplicateError2 ¶
func IsExistsString ¶
func IsFileExisted ¶
func IsNotEmpty ¶
func IsPublicIP ¶
func IsRegularOrNotExists ¶
func MergeValues ¶
func NowDateString ¶
func NowDateString() string
func NowDateTimeString ¶
func NowDateTimeString() string
func ParseAddress ¶
func ParseScreen ¶
func RandNumberString ¶
func ReadJson ¶
func ReadJson(reader io.ReadCloser, data interface{}) error
func RenderHtml ¶
func RepeatString ¶
func SplitToIntSlice ¶
func StringS2Interface ¶
func StringS2Interface(slice []string) []interface{}
func StringSliceToInt ¶
func StringSliceToInt64 ¶
func TimestampToTime ¶
func ToTimestamp ¶
func UniqueInt64Slice ¶
func UniqueIntSlice ¶
func WriteUploadFile ¶
func WriteUploadFile(fileheaer *multipart.FileHeader, dst string) error
Types ¶
type PagingParams ¶
type PagingParams struct { LowerId int64 `form:"lowerId"` UpperId int64 `form:"upperId"` StartId int64 `form:"startId"` PageSize int64 `form:"pageSize"` PageIndex int64 `form:"pageIndex"` Reverse bool `form:"reverse"` }
func (*PagingParams) Adjust ¶
func (pp *PagingParams) Adjust(count int64, defaultPageSize int64)
Click to show internal directories.
Click to hide internal directories.