Versions in this module Expand all Collapse all v0 v0.10.0 Jan 14, 2024 v0.2.0 Mar 4, 2024 v0.1.7 Feb 27, 2024 v0.1.6 Jan 24, 2024 v0.1.5 Jan 18, 2024 v0.1.4 Jan 18, 2024 v0.1.3 Jan 18, 2024 v0.1.2 Jan 17, 2024 v0.1.1 Jan 15, 2024 v0.1.0 Jan 14, 2024 v0.0.1 Jan 12, 2024 Changes in this version + var ErrInvalidHex = errors.New("the provided hex string is not a valid ObjectID") + func HidePhoneMiddle(phone string) string + func IsChinesePhone(phone string) bool + func IsPhone(phone string) bool + func IsValidObjectID(s string) bool + func SetReqDataContext(ctx context.Context, data ReqData) context.Context + func SliceRemoveDuplicate(x interface{}, fn func(i, j int) bool) + func TrimStringToFloat(s string) (float64, error) + func TrimStringToInt(s string) (int, error) + type BaseResp struct + TraceID string + func NewBaseResp(code int, msg string) *BaseResp + func (b *BaseResp) WriteTraceID(ctx context.Context) *BaseResp + type DataResp struct + Data interface{} + func NewDataResp(baseResp *BaseResp, data interface{}) *DataResp + func Resp(data interface{}, err error, ctx ...context.Context) *DataResp + type IdOmitReq struct + Id int64 + type IdReq struct + Id int64 + type IntSplit string + func (is IntSplit) Unmarshal() ([]int, error) + type IsLimit int + func (i IsLimit) All() bool + func (i IsLimit) Val() int + type ListResp struct + Count int64 + List interface{} + type LoginReq struct + Password string + Username string + type LoginResp struct + Nickname string + Role string + Token string + type ObjectID [12]byte + var NilObjectID ObjectID + func NewObjectID() ObjectID + func NewObjectIDFromTimestamp(timestamp time.Time) ObjectID + func ObjectIDFromHex(s string) (ObjectID, error) + func (id *ObjectID) UnmarshalJSON(b []byte) error + func (id ObjectID) Hex() string + func (id ObjectID) IsZero() bool + func (id ObjectID) MarshalJSON() ([]byte, error) + func (id ObjectID) String() string + func (id ObjectID) Timestamp() time.Time + type PageReq struct + Page int + Size int + func (req PageReq) LimitStart() (limit, start int) + func (req PageReq) Skip() int64 + type ReqData struct + Body string + InternalErr string + Msg string + RemoteAddr string + Route string + Uid string + func GetReqDataContext(ctx context.Context) ReqData + type StringSplit string + func (ss StringSplit) Marshal(val []string) StringSplit + func (ss StringSplit) Unmarshal() []string + type TimeStringReq struct + EndTime string + StartTime string + func (req TimeStringReq) FieldMgoBson() (map[string]interface{}, bool) + func (req TimeStringReq) FieldSQLCond(field string) []string + type TimestampReq struct + EndTimestamp int64 + StartTimestamp int64 + func (req TimestampReq) FieldMgoBson() (map[string]interface{}, bool) + func (req TimestampReq) FieldSQLCond(field string) []string + type UidOmitReq struct + Uid int64 + type UidReq struct + Uid int64