orm

package module
v0.0.0-...-60a21d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

orm

介绍

技术研究

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastType

func CastType(value *reflect.Value, from reflect.Kind, to reflect.Kind) bool

CastType cast type

func GetTagName

func GetTagName(field reflect.StructField, name string) string

GetTagName get the tag name of the reflect.StructField

func ToSnakeCase

func ToSnakeCase(str string) string

ToSnakeCase convert camel case string to snake case

func UpperFirst

func UpperFirst(str string) string

UpperFirst upcase the first letter

Types

type N

type N struct {
	Number interface{}
}

func MakeN

func MakeN(v interface{}) N

MakeN Create a new xun.N struct

func MakeNum

func MakeNum(v interface{}) N

MakeNum Create a new xun.N struct ( alias MakeN )

func (N) Float64

func (n N) Float64() (float64, error)

Float64 the return value is the type of float64

func (N) Int

func (n N) Int() (int, error)

Int the return value is the type of int and remove the decimal

func (N) Int32

func (n N) Int32() (int32, error)

Int32 the return value is the type of int64 and remove the decimal

func (N) Int64

func (n N) Int64() (int64, error)

Int64 the return value is the type of int64 and remove the decimal

func (*N) MarshalJSON

func (n *N) MarshalJSON() ([]byte, error)

MarshalJSON for json marshalJSON

func (N) MustFloat64

func (n N) MustFloat64() float64

MustFloat64 the return value is the type of float64

func (N) MustInt

func (n N) MustInt() int

MustInt the return value is the type of int and remove the decimal

func (N) MustInt32

func (n N) MustInt32() int32

MustInt32 the return value is the type of int64 and remove the decimal

func (N) MustInt64

func (n N) MustInt64() int64

MustInt64 the return value is the type of int64 and remove the decimal

func (N) MustToFixed

func (n N) MustToFixed(places int) float64

MustToFixed the return value is the type of float64 and keeps the given decimal places

func (*N) Scan

func (n *N) Scan(src interface{}) error

Scan for db scan

func (N) ToFixed

func (n N) ToFixed(places int) (float64, error)

ToFixed the return value is the type of float64 and keeps the given decimal places

func (*N) UnmarshalJSON

func (n *N) UnmarshalJSON(data []byte) error

UnmarshalJSON for json marshalJSON

func (*N) Value

func (n *N) Value() (driver.Value, error)

Value for db driver value

type P

type P struct {
	Items        []interface{}          `json:"items"`
	Total        int                    `json:"total"`
	TotalPages   int                    `json:"total_pages"`
	PageSize     int                    `json:"page_size"`
	CurrentPage  int                    `json:"current_page"`
	NextPage     int                    `json:"next_page"`
	PreviousPage int                    `json:"previous_page"`
	LastPage     int                    `json:"last_page"`
	Options      map[string]interface{} `json:"options,omtempty"`
}

func MakeP

func MakeP(total int, pageSize int, currentPage int, items ...interface{}) P

MakeP create a new P struct

func MakePaginator

func MakePaginator(total int, pageSize int, currentPage int, items ...interface{}) P

MakePaginator create a new P struct alias MakeP

type R

type R map[string]interface{}

func MakeR

func MakeR(value ...interface{}) R

MakeR create a new R struct

func MakeRSlice

func MakeRSlice(value ...interface{}) []R

MakeRSlice convert any struct to R slice

func MakeRow

func MakeRow(value ...interface{}) R

MakeRow create a new R struct alias MakeR

func MakeRows

func MakeRows(value ...interface{}) []R

MakeRows convert any struct to R slice alias MakeRSlice

func (R) Del

func (row R) Del(key string)

Del delete value with given key

func (R) Get

func (row R) Get(key interface{}) interface{}

Get get the value of the given key

func (R) GetBool

func (row R) GetBool(key interface{}) bool

GetBool get the int value of the given key

func (R) GetFloat

func (row R) GetFloat(key interface{}, places int) float64

GetFloat get the float value of the given key

func (R) GetInt

func (row R) GetInt(key interface{}) int

GetInt get the int value of the given key

func (R) GetString

func (row R) GetString(key interface{}) string

GetString get the string value of the given key

func (R) GetTime

func (row R) GetTime(key interface{}) T

GetTime get the value of the given key, and cast the type to xun.T

func (R) Has

func (row R) Has(key string) bool

Has detemind if has the given key

func (R) IsEmpty

func (row R) IsEmpty() bool

IsEmpty determine if the row is null

func (R) Keys

func (row R) Keys() []interface{}

Keys get keys of R

func (R) KeysString

func (row R) KeysString() []string

KeysString get keys of R

func (*R) Merge

func (row *R) Merge(v ...interface{})

Merge get keys of R

func (R) MustGet

func (row R) MustGet(key interface{}) interface{}

MustGet get the value of the given key, if key does not exits painc

func (R) ToMap

func (row R) ToMap() map[string]interface{}

ToMap cast to map[string]interface{}

func (R) Value

func (row R) Value(key interface{}) interface{}

Value get the value of the given key ( alias Get)

type T

type T struct {
	Time interface{}
}

func MakeTime

func MakeTime(value ...interface{}) T

MakeTime Create a new time struct

func (T) IsNull

func (t T) IsNull() bool

IsNull determine if the time is null

func (*T) MarshalJSON

func (t *T) MarshalJSON() ([]byte, error)

MarshalJSON for json marshalJSON

func (T) MustToTime

func (t T) MustToTime(formats ...string) time.Time

MustToTime cast the T to time.Time

func (*T) Scan

func (t *T) Scan(src interface{}) error

Scan for db scan

func (T) ToTime

func (t T) ToTime(formats ...string) (time.Time, error)

ToTime cast the T to time.Time

func (*T) UnmarshalJSON

func (t *T) UnmarshalJSON(data []byte) error

UnmarshalJSON for json marshalJSON

func (*T) Value

func (t *T) Value() (driver.Value, error)

Value for db driver value

type UploadFile

type UploadFile struct {
	Name     string
	TempFile string
	Size     int64
	Header   textproto.MIMEHeader
}

Directories

Path Synopsis
grammar
sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL