Documentation ¶
Index ¶
- Constants
- Variables
- func HMacSha256(key []byte, data []byte) string
- func LocalTimeZone() *time.Location
- func ParseDateTime(layout string, value string) (*time.Time, error)
- type Choice
- type ChoiceType
- type Coordinate
- type Date
- type DateTime
- func (dt DateTime) GormDBDataType(db *gorm.DB, field *schema.Field) string
- func (dt DateTime) GormValue(ctx context.Context, db *gorm.DB) clause.Expr
- func (dt DateTime) MarshalJSON() ([]byte, error)
- func (dt *DateTime) Scan(value any) error
- func (dt DateTime) String() string
- func (dt *DateTime) UnmarshalJSON(data []byte) error
- type JSON
- type JSONQueryExpression
- func (jsonQuery *JSONQueryExpression) Build(builder clause.Builder)
- func (jsonQuery *JSONQueryExpression) Equals(value any, keys ...string) *JSONQueryExpression
- func (jsonQuery *JSONQueryExpression) Extract(path string) *JSONQueryExpression
- func (jsonQuery *JSONQueryExpression) HasKey(keys ...string) *JSONQueryExpression
- type Password
- func (p *Password) Compare(password string) bool
- func (p Password) MarshalJSON() ([]byte, error)
- func (p *Password) Scan(value any) error
- func (p Password) String() string
- func (p *Password) UnmarshalJSON(data []byte) error
- func (p *Password) Update(password string)
- func (p Password) Value() (driver.Value, error)
- type Storage
- type StorageConfig
- type StorageService
- type Time
Constants ¶
View Source
const (
DateTimeTZFormat = time.DateTime + "-07:00"
)
Variables ¶
View Source
var DefaultStorageConfig = StorageConfig{ Signatured: false, BucketName: "app", Expired: 5 * time.Minute, Cache: cache.New(5*time.Minute, 10*time.Minute), }
View Source
var (
TimeZone = "Asia/Shanghai"
)
Functions ¶
func LocalTimeZone ¶
Types ¶
type ChoiceType ¶
func (*ChoiceType) UnmarshalJSON ¶
func (c *ChoiceType) UnmarshalJSON(data []byte) error
type Coordinate ¶
type Coordinate struct { Longitude float64 `json:"longitude" validate:"required"` Latitude float64 `json:"latitude" validate:"required"` }
func (*Coordinate) Scan ¶
func (c *Coordinate) Scan(value any) error
type DateTime ¶
func NewDateTime ¶
func (DateTime) GormDBDataType ¶
GORM
func (*DateTime) UnmarshalJSON ¶
type JSON ¶
func (JSON) GormDBDataType ¶
GORM
type JSONQueryExpression ¶
type JSONQueryExpression struct {
// contains filtered or unexported fields
}
func (*JSONQueryExpression) Build ¶
func (jsonQuery *JSONQueryExpression) Build(builder clause.Builder)
Build
func (*JSONQueryExpression) Equals ¶
func (jsonQuery *JSONQueryExpression) Equals(value any, keys ...string) *JSONQueryExpression
Equals
func (*JSONQueryExpression) Extract ¶
func (jsonQuery *JSONQueryExpression) Extract(path string) *JSONQueryExpression
Extract
func (*JSONQueryExpression) HasKey ¶
func (jsonQuery *JSONQueryExpression) HasKey(keys ...string) *JSONQueryExpression
HasKey
type Password ¶
type Password struct {
// contains filtered or unexported fields
}
func (*Password) UnmarshalJSON ¶
type StorageConfig ¶
type StorageConfig struct { // 是否签名 Signatured bool // 服务器URL ServerURL string // Bucket名称 BucketName string // 访问Key AccessKey string // 签名Key SignatureKey string // 过期时间 Expired time.Duration // 缓存 Cache *cache.Cache // 存储服务 Service StorageService }
func (StorageConfig) HasSignature ¶
func (c StorageConfig) HasSignature() bool
type StorageService ¶
type StorageService interface { GetToken(config StorageConfig) string UploadFile(data []byte, token string, config StorageConfig) string }
Click to show internal directories.
Click to hide internal directories.