Documentation ¶
Index ¶
- Constants
- func ConvertToUUIDAndBinary(v interface{}) (*uuid.UUID, *bson.Binary)
- func FindInSliceUUID(slice []*uuid.UUID, uid *uuid.UUID) (exists bool, index int)
- func GetBsonSlice(uuids []*uuid.UUID) []*bson.Binary
- func GetENV(key string, defaultValue string) string
- func GetUUIDFromBson(binary *bson.Binary) uuid.UUID
- func IsCompany(citizen string) bool
- func SetUUIDBson(id uuid.UUID) *bson.Binary
- func ToUUIDBson(v interface{}) *bson.Binary
- func UUIDToSliceString(slice []*uuid.UUID) []string
- func ValidCitizenId(citizen string) bool
- func ValidateKeyExists(keys []string, params map[string]interface{}) map[string]error
- func ValidateNotSpace(val interface{}) error
- func ValidateOnlyThaiLetterNumeric(val interface{}) error
- func ValidateTimeISO8601(val interface{}) error
- func ValidateTypeBool(v interface{}) error
- func ValidateTypeBoolString(v interface{}) error
- func ValidateTypeFloat(val interface{}) error
- func ValidateTypeInt(val interface{}) error
- func ValidateTypeMap(val interface{}) error
- func ValidateTypeMapWithNull(val interface{}) error
- func ValidateTypeSlice(val interface{}) error
- func ValidateTypeString(val interface{}) error
- func ValidateTypeUUID(val interface{}) error
- func ValidateUUIDOrIDZero(val interface{}) error
- type Date
- type GUIDWrapper
- type NullUUID
- type Paginator
- type Timestamp
- func (j Timestamp) Format(s string) string
- func (j *Timestamp) GetBSON() (interface{}, error)
- func (j *Timestamp) Interface() interface{}
- func (j Timestamp) MarshalJSON() ([]byte, error)
- func (t *Timestamp) Scan(value interface{}) error
- func (j Timestamp) String() string
- func (j Timestamp) ToTime() time.Time
- func (t Timestamp) ToUnix() int64
- func (j *Timestamp) UnmarshalJSON(b []byte) error
- func (j Timestamp) Value() (driver.Value, error)
- func (j Timestamp) ValueOrZero() string
- func (j Timestamp) YearDay() int
- type ZeroUUID
- func (zu ZeroUUID) Interface() interface{}
- func (zu ZeroUUID) IsZero() bool
- func (zu ZeroUUID) MarshalBinary() ([]byte, error)
- func (zu ZeroUUID) MarshalJSON() ([]byte, error)
- func (zu ZeroUUID) NullUUID() NullUUID
- func (zu *ZeroUUID) Scan(src interface{}) error
- func (zu ZeroUUID) String() string
- func (zu ZeroUUID) ToBsonBinary() *bson.Binary
- func (zu ZeroUUID) ToUUID() *uuid.UUID
- func (zu *ZeroUUID) UnmarshalBinary(data []byte) error
- func (zu ZeroUUID) UnmarshalJSON(b []byte) error
- func (zu *ZeroUUID) UnmarshalText(text []byte) error
- func (zu ZeroUUID) Value() (driver.Value, error)
Constants ¶
View Source
const (
DateLayout = "2006-01-02"
)
View Source
const (
PSQL_TOTAL_ROW_KEY = "total_row"
)
View Source
const (
TimestampLayout = "2006-01-02 15:04:05" // 2006-01-02 15:04:05, 2006-01-02T15:04:05
)
Variables ¶
This section is empty.
Functions ¶
func FindInSliceUUID ¶
func ToUUIDBson ¶
func UUIDToSliceString ¶
func ValidCitizenId ¶
func ValidateKeyExists ¶
func ValidateNotSpace ¶
func ValidateNotSpace(val interface{}) error
func ValidateOnlyThaiLetterNumeric ¶
func ValidateOnlyThaiLetterNumeric(val interface{}) error
func ValidateTimeISO8601 ¶
func ValidateTimeISO8601(val interface{}) error
func ValidateTypeBool ¶
func ValidateTypeBool(v interface{}) error
func ValidateTypeBoolString ¶
func ValidateTypeBoolString(v interface{}) error
func ValidateTypeFloat ¶
func ValidateTypeFloat(val interface{}) error
func ValidateTypeInt ¶
func ValidateTypeInt(val interface{}) error
func ValidateTypeMap ¶
func ValidateTypeMap(val interface{}) error
func ValidateTypeMapWithNull ¶
func ValidateTypeMapWithNull(val interface{}) error
func ValidateTypeSlice ¶
func ValidateTypeSlice(val interface{}) error
func ValidateTypeString ¶
func ValidateTypeString(val interface{}) error
func ValidateTypeUUID ¶
func ValidateTypeUUID(val interface{}) error
func ValidateUUIDOrIDZero ¶
func ValidateUUIDOrIDZero(val interface{}) error
Types ¶
type Date ¶
func NewDateFromString ¶
func NewDateFromTime ¶
func (Date) MarshalJSON ¶
func (*Date) UnmarshalJSON ¶
type GUIDWrapper ¶
func NewGUIDWrapper ¶
func NewGUIDWrapper() GUIDWrapper
func NewGUIDWrapperFromString ¶
func NewGUIDWrapperFromString(s string) GUIDWrapper
func (GUIDWrapper) MarshalJSON ¶
func (g GUIDWrapper) MarshalJSON() ([]byte, error)
สำหรับ JSON marshaling
func (*GUIDWrapper) Scan ¶
func (g *GUIDWrapper) Scan(value interface{}) error
Implement Scanner interface for GUIDWrapper
func (*GUIDWrapper) UnmarshalJSON ¶
func (g *GUIDWrapper) UnmarshalJSON(data []byte) error
สำหรับ JSON unmarshaling
type Paginator ¶
type Paginator struct { Page int `json:"page"` PerPage int `json:"per_page"` TotalPages int `json:"total_page"` TotalEntrySizes int `json:"total_rows"` }
func NewPaginator ¶
func NewPaginator() Paginator
func NewPaginatorWithParams ¶
func (*Paginator) SetPaginatorByAllRows ¶
type Timestamp ¶
func NewTimestampFromString ¶
func NewTimestampFromTime ¶
func (Timestamp) MarshalJSON ¶
func (*Timestamp) UnmarshalJSON ¶
func (Timestamp) ValueOrZero ¶
type ZeroUUID ¶
func NewZeroUUIDFromstring ¶
func (ZeroUUID) MarshalBinary ¶
func (ZeroUUID) MarshalJSON ¶
func (ZeroUUID) ToBsonBinary ¶
func (*ZeroUUID) UnmarshalBinary ¶
func (ZeroUUID) UnmarshalJSON ¶
func (*ZeroUUID) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.