Documentation
¶
Index ¶
- Constants
- func Base64ToImage(base64String, outputPath string) error
- func Base64ToImageWithFormat(base64String, outputPath, format string) error
- func Compress(filePath string) string
- func Float64Trans(value string) *float64
- func GenerateString(length int) (str string)
- func GetCapitalPass(val string) string
- func GetFileList(path string) []string
- func GetImageFormatFromBase64(base64String string) string
- func InStrArray(ext string, code int) bool
- func IntTrans(value string) *int
- func ResAddFile(onePath string)
- func Sha256(src string) string
- func StrTrans(value string) *string
- func TimeTrans(value string) *gtime.Time
- func Transaction(function func() error)
- type Curd
- func (c Curd[R]) All(ctx ctx, where any, order any, with bool) (items []*R, err error)
- func (c Curd[R]) ArrayField(ctx ctx, where any, field any) ([]*gvar.Var, error)
- func (c Curd[R]) BuildMap(op string, value any, field ...string) map[string]any
- func (c Curd[R]) BuildWhere(req any, changeWhere any, subWhere any, removeFields []string, isSnake ...bool) map[string]any
- func (c Curd[R]) Builder(ctx context.Context) *gdb.WhereBuilder
- func (c Curd[R]) ClearField(req any, delField []string, subField ...map[string]any) map[string]any
- func (c Curd[R]) ClearFieldList(ctx ctx, req any, delField []string, where any, order any, with bool) (items []*R, err error)
- func (c Curd[R]) ClearFieldOne(ctx ctx, req any, delField []string, where any, order any, with bool) (items *R, err error)
- func (c Curd[R]) ClearFieldPage(ctx ctx, req any, delField []string, where any, page *Paginate, order any, ...) (items []*R, total int, err error)
- func (c Curd[R]) Count(ctx ctx, where any) (count int, err error)
- func (c Curd[R]) DeletePri(ctx ctx, primaryKey any) error
- func (c Curd[R]) DeleteWhere(ctx ctx, where any) error
- func (c Curd[R]) Exists(ctx ctx, where any) (exists bool, err error)
- func (c Curd[R]) FindPri(ctx ctx, primaryKey any, with bool) (model *R, err error)
- func (c Curd[R]) First(ctx ctx, where any, order any, with bool) (model *R, err error)
- func (c Curd[R]) Paginate(ctx context.Context, where any, p Paginate, with bool, order any) (items []*R, total int, err error)
- func (c Curd[R]) Save(ctx ctx, data any) (id int64, err error)
- func (c Curd[R]) Sum(ctx ctx, where any, field string) (float64, error)
- func (c Curd[R]) Update(ctx ctx, where any, data any) (count int64, err error)
- func (c Curd[R]) UpdatePri(ctx ctx, primaryKey any, data any) (count int64, err error)
- func (c Curd[R]) Value(ctx ctx, where any, field any) (*gvar.Var, error)
- type IDao
- type ListRes
- type NormalRes
- type Paginate
- type Paginator
- type SClient
- func (w *SClient[R]) Delete(ctx context.Context) (res *R, err error)
- func (w *SClient[R]) Get(ctx context.Context) (res *R, err error)
- func (w *SClient[R]) Patch(ctx context.Context) (res *R, err error)
- func (w *SClient[R]) Post(ctx context.Context) (res *R, err error)
- func (w *SClient[R]) Put(ctx context.Context) (res *R, err error)
Constants ¶
View Source
const ( CharsetLower = "abcdefghijklmnopqrstuvwxyz" CharsetUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" CharsetNumber = "0123456789" CharsetDefault = CharsetLower + CharsetUpper + CharsetNumber )
Variables ¶
This section is empty.
Functions ¶
func Base64ToImage ¶
Base64ToImage 将Base64编码的数据转换为图片并保存到指定路径
func Base64ToImageWithFormat ¶
Base64ToImageWithFormat 将Base64编码的数据转换为指定格式的图片并保存
func Float64Trans ¶
func GetFileList ¶
GetFileList 获取文件列表
- 根据传入的路径返回该路径下的所有可访问的列表
- 要求必须将静态文件访问路径定义为static,且静态文件访问目录为resource
func GetImageFormatFromBase64 ¶
GetImageFormatFromBase64 从Base64数据中获取图片格式
func ResAddFile ¶
func ResAddFile(onePath string)
ResAddFile 添加文件到资源包
- @param onePath string
- 例:gf pack resource/dist internal/boot/boot_resource.go -n boot
- 需要在boot中 打包引入 并在main.go中引入boot
Types ¶
type Curd ¶
type Curd[R any] struct { Dao IDao Hook gdb.HookHandler }
func (Curd[R]) ArrayField ¶
func (Curd[R]) BuildWhere ¶
func (Curd[R]) ClearField ¶
func (Curd[R]) ClearFieldList ¶
func (Curd[R]) ClearFieldOne ¶
func (Curd[R]) ClearFieldPage ¶
func (Curd[R]) DeleteWhere ¶
type ListRes ¶
func NewListRes ¶
type NormalRes ¶
type NormalRes[T any] struct { Code int `json:"code" dc:"code"` Data T `json:"data" dc:"data 可null"` Msg string `json:"msg" dc:"return msg"` }
func NewNormalRes ¶
Click to show internal directories.
Click to hide internal directories.