Documentation ¶
Index ¶
- Constants
- Variables
- func AddColumnAndValue(name string, table dbEngine.Table, arg interface{}, buf io.Writer, ...) (string, interface{})
- func ArrayToStrings(v *pgtype.ArrayType) ([]string, bool)
- func BPCharArrayToStrings(src []pgtype.BPChar) []string
- func BlobToURL(tableName string, colName string, id int32) string
- func CreateErrResult(err error) (any, error)
- func DecodeDatetimeString(ptr unsafe.Pointer, iter *jsoniter.Iterator)
- func EncodeDateString(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func GetForeignName(ctx *fasthttp.RequestCtx, DB *DB, col Column, val interface{}) interface{}
- func GetForeignOptions(ctx *fasthttp.RequestCtx, DB *dbEngine.DB, colDec *forms.ColumnDecor, id any)
- func GetNameAccordingLang(table Table, name string, lang interface{}) string
- func GetNameOfTitleColumn(table Table, lang interface{}) string
- func Int4ArrToStrings(src []pgtype.Int4) []int32
- func Int8ArrToStrings(src []pgtype.Int8) []int64
- func IsEmptyDateString(ptr unsafe.Pointer) bool
- func ReadByteA(fHeaders []*multipart.FileHeader) ([]string, [][]byte, error)
- func RenderAcceptedResult(ctx *fasthttp.RequestCtx, colSel []string, buf *bytes.Buffer, route string) (any, error)
- func RenderCreatedResult(ctx *fasthttp.RequestCtx, id int64, buf *bytes.Buffer, colSel []string, ...) (any, error)
- func RoutesFromDB(ctx context.Context, routeTypes []DbRouteType, tables ...string) apis.ApiRoutes
- func TableForm(DB *DB, preRoute string, table Table, priColumns []string) apis.ApiRouteHandler
- func TableInsert(preRoute string, table dbEngine.Table, params []string) apis.ApiRouteHandler
- func TableSelect(table dbEngine.Table, params []string) apis.ApiRouteHandler
- func TableUpdate(preRoute string, table dbEngine.Table, columns, priColumns []string) apis.ApiRouteHandler
- func TextArrayToStrings(src []pgtype.Text) []string
- func TimeToString(v time.Time) string
- func ToColDev(ctx *fasthttp.RequestCtx, DB *dbEngine.DB, patternList dbEngine.Table, ...) *forms.ColumnDecor
- func ToStandartColumnValueType(tableName, colName string, id int32, values interface{}) interface{}
- func UnknownArrayToStrings(src []interface{}) []string
- func VarcharArrayToStrings(src []pgtype.Varchar) []string
- type DateRangeMarshal
- type DateString
- type DateTimeString
- func (d *DateTimeString) CheckParams(ctx *fasthttp.RequestCtx, badParams map[string]string) bool
- func (d *DateTimeString) Expect() string
- func (d *DateTimeString) Format() string
- func (d *DateTimeString) GetValue() any
- func (d *DateTimeString) MarshalJSON() ([]byte, error)
- func (d *DateTimeString) NewValue() any
- func (d *DateTimeString) RequestType() string
- func (d *DateTimeString) Scan(src any) error
- func (d *DateTimeString) UnmarshalJSON(src []byte) (err error)
- type DbApiParams
- type DbRouteType
- type DtoField
- type DtoFileField
- func (d *DtoFileField) CheckParams(ctx *fasthttp.RequestCtx, badParams map[string]string) bool
- func (d *DtoFileField) Expect() string
- func (d *DtoFileField) Format() string
- func (d *DtoFileField) GetValue() interface{}
- func (d *DtoFileField) NewValue() interface{}
- func (d *DtoFileField) RequestType() string
- type FormActions
- type InetMarshal
- type IntervalMarshal
Constants ¶
View Source
const ( UserPrivelegiesGrant = "grant" UsersPrivilegiesEdit = "edit" ActionsPropertyName = "actions" )
View Source
const PathVersion = "/api/v1"
Variables ¶
View Source
var ( ParamsID = apis.InParam{ Name: "id", Req: false, Type: apis.NewTypeInParam(types.Int32), } ParamsLang = apis.InParam{ Name: "lang", Desc: "need to get result on non-english", DefValue: apis.DefValueCalcFnc(func(ctx *fasthttp.RequestCtx) any { if cL := ctx.Request.Header.Peek("Accept-Language"); len(cL) > 0 { return gotools.BytesToString(cL) } return "en" }), Req: true, Type: apis.NewTypeInParam(types.String), } ParamsGetFormActions = apis.InParam{ Name: "is_get_form_actions", Desc: "need to get form actions in response", Req: false, Type: apis.NewTypeInParam(types.Bool), } ParamsLimit = apis.InParam{ Name: "limit", Desc: "max count of queries results", DefValue: 1000, Req: true, Type: apis.NewTypeInParam(types.Int), } ParamsOffset = apis.InParam{ Name: "offset", Desc: "offset of queries results", Req: false, Type: apis.NewTypeInParam(types.Int), } ParamsHTML = apis.InParam{ Name: "html", Desc: "need for get result in html instead JSON", Req: false, Type: apis.NewTypeInParam(types.Bool), } ParamsEmail = apis.InParam{ Name: "email", Desc: "email for login", Req: true, Type: apis.NewTypeInParam(types.String), } ParamsPassword = apis.InParam{ Name: "key", Desc: "password or other key word (on future)", Req: true, Type: apis.NewTypeInParam(types.String), } ParamsWhere = apis.InParam{ Name: "where", Desc: "conditions for query ('where' clause)", Type: apis.NewTypeInParam(types.String), } ParamsOrderBy = apis.InParam{ Name: "order_by", Desc: "conditions for sort queries data ('order by' clause)", Type: apis.NewTypeInParam(types.String), } ParamsSelect = apis.InParam{ Name: "select[]", Desc: "list of columns for query ('select' clause)", Type: apis.NewSliceTypeInParam(types.String), } ParamsName = apis.InParam{ Name: "name", Desc: "name of search table", DefValue: apis.ApisValues(apis.ChildRoutePath), Req: true, Type: apis.NewTypeInParam(types.String), } BasicParams = []apis.InParam{ ParamsHTML, ParamsLang, } )
Functions ¶
func AddColumnAndValue ¶ added in v1.2.3
func BPCharArrayToStrings ¶
func CreateErrResult ¶
func EncodeDateString ¶ added in v1.2.90
func GetForeignName ¶
func GetForeignName(ctx *fasthttp.RequestCtx, DB *DB, col Column, val interface{}) interface{}
func GetForeignOptions ¶
func GetForeignOptions(ctx *fasthttp.RequestCtx, DB *dbEngine.DB, colDec *forms.ColumnDecor, id any)
func GetNameAccordingLang ¶
func GetNameOfTitleColumn ¶
func GetNameOfTitleColumn(table Table, lang interface{}) string
func Int4ArrToStrings ¶
func Int8ArrToStrings ¶
func IsEmptyDateString ¶ added in v1.2.90
func ReadByteA ¶ added in v1.2.14
func ReadByteA(fHeaders []*multipart.FileHeader) ([]string, [][]byte, error)
func RenderAcceptedResult ¶ added in v1.2.3
func RenderCreatedResult ¶ added in v1.1.10122
func RoutesFromDB ¶
func TableForm ¶
func TableForm(DB *DB, preRoute string, table Table, priColumns []string) apis.ApiRouteHandler
func TableInsert ¶
TableInsert insert data of params into table
func TableSelect ¶
func TableSelect(table dbEngine.Table, params []string) apis.ApiRouteHandler
func TableUpdate ¶
func TableUpdate(preRoute string, table dbEngine.Table, columns, priColumns []string) apis.ApiRouteHandler
TableUpdate
func TextArrayToStrings ¶
func TimeToString ¶
func UnknownArrayToStrings ¶
func UnknownArrayToStrings(src []interface{}) []string
func VarcharArrayToStrings ¶
Types ¶
type DateRangeMarshal ¶ added in v1.2.21
func (*DateRangeMarshal) GetValue ¶ added in v1.2.21
func (d *DateRangeMarshal) GetValue() any
func (*DateRangeMarshal) NewValue ¶ added in v1.2.21
func (d *DateRangeMarshal) NewValue() any
func (*DateRangeMarshal) Set ¶ added in v1.2.21
func (d *DateRangeMarshal) Set(src any) error
type DateString ¶ added in v1.2.86
func (*DateString) Expect ¶ added in v1.2.88
func (d *DateString) Expect() string
func (*DateString) Format ¶ added in v1.2.88
func (d *DateString) Format() string
func (*DateString) GetValue ¶ added in v1.2.88
func (d *DateString) GetValue() any
func (*DateString) MarshalJSON ¶ added in v1.2.89
func (d *DateString) MarshalJSON() ([]byte, error)
func (*DateString) NewValue ¶ added in v1.2.88
func (d *DateString) NewValue() any
func (*DateString) RequestType ¶ added in v1.2.88
func (d *DateString) RequestType() string
func (*DateString) UnmarshalJSON ¶ added in v1.2.86
func (d *DateString) UnmarshalJSON(src []byte) (err error)
type DateTimeString ¶
func (*DateTimeString) CheckParams ¶
func (d *DateTimeString) CheckParams(ctx *fasthttp.RequestCtx, badParams map[string]string) bool
func (*DateTimeString) Expect ¶ added in v1.2.22
func (d *DateTimeString) Expect() string
func (*DateTimeString) Format ¶ added in v1.2.22
func (d *DateTimeString) Format() string
func (*DateTimeString) GetValue ¶ added in v1.2.21
func (d *DateTimeString) GetValue() any
func (*DateTimeString) MarshalJSON ¶
func (d *DateTimeString) MarshalJSON() ([]byte, error)
func (*DateTimeString) NewValue ¶ added in v1.2.21
func (d *DateTimeString) NewValue() any
func (*DateTimeString) RequestType ¶ added in v1.2.22
func (d *DateTimeString) RequestType() string
func (*DateTimeString) Scan ¶
func (d *DateTimeString) Scan(src any) error
func (*DateTimeString) UnmarshalJSON ¶
func (d *DateTimeString) UnmarshalJSON(src []byte) (err error)
type DbApiParams ¶ added in v1.2.3
func NewDbApiParams ¶ added in v1.2.3
func NewDbApiParams(col dbEngine.Column) *DbApiParams
func (*DbApiParams) ConvertDbType ¶ added in v1.2.3
func (p *DbApiParams) ConvertDbType(col dbEngine.Column)
type DbRouteType ¶ added in v1.2.2
type DbRouteType int
const ( DbRouteType_Insert DbRouteType = iota DbRouteType_Update DbRouteType_Select )
type DtoField ¶ added in v1.2.21
func (*DtoField) CheckParams ¶ added in v1.2.21
CheckParams implement CheckDTO interface, put each params into user value on context
func (*DtoField) RequestType ¶ added in v1.2.22
type DtoFileField ¶ added in v1.2.25
type DtoFileField []*multipart.FileHeader
func (*DtoFileField) CheckParams ¶ added in v1.2.25
func (d *DtoFileField) CheckParams(ctx *fasthttp.RequestCtx, badParams map[string]string) bool
CheckParams implement CheckDTO interface, put each params into user value on context
func (*DtoFileField) Expect ¶ added in v1.2.25
func (d *DtoFileField) Expect() string
func (*DtoFileField) Format ¶ added in v1.2.25
func (d *DtoFileField) Format() string
func (*DtoFileField) GetValue ¶ added in v1.2.25
func (d *DtoFileField) GetValue() interface{}
func (*DtoFileField) NewValue ¶ added in v1.2.25
func (d *DtoFileField) NewValue() interface{}
func (*DtoFileField) RequestType ¶ added in v1.2.25
func (d *DtoFileField) RequestType() string
type FormActions ¶
type InetMarshal ¶ added in v1.2.29
func (*InetMarshal) GetValue ¶ added in v1.2.29
func (i *InetMarshal) GetValue() any
func (*InetMarshal) NewValue ¶ added in v1.2.29
func (i *InetMarshal) NewValue() any
func (*InetMarshal) Set ¶ added in v1.2.29
func (i *InetMarshal) Set(src any) error
type IntervalMarshal ¶ added in v1.2.21
func (*IntervalMarshal) GetValue ¶ added in v1.2.21
func (i *IntervalMarshal) GetValue() any
func (*IntervalMarshal) NewValue ¶ added in v1.2.21
func (i *IntervalMarshal) NewValue() any
func (*IntervalMarshal) Set ¶ added in v1.2.27
func (i *IntervalMarshal) Set(src any) error
Click to show internal directories.
Click to hide internal directories.