Documentation ¶
Index ¶
- Constants
- func GetKnownObjects() map[string]*Object
- func SaveObject(name string, obj reflect.Type, withArray bool, withCU bool) (err error)
- func StructType(v any) (t reflect.Type, err error)
- type Chain
- type Chains
- type ChainsList
- type Flags
- type Methods
- type Object
- type Params
- type ParamsObject
- type RequestParams
- type ResponseParams
- type Set
- type Token
- type Vars
Constants ¶
View Source
const ( NoFlags = Flags(0x00000000) FlagResponseHashed = Flags(0x00000001) FlagRequestDontMakeFlatModel = Flags(0x00000002) FlagResponseIsNotArray = Flags(0x00000004) FlagUDqueriesReturnsID = Flags(0x00000008) FlagWithoutCU = Flags(0x00000010) FlagBodyReaderNeeded = Flags(0x00000020) FlagChainDefault = Flags(0x00000001) FlagChainEnableTail = Flags(0x00000002) // VarName VarIgnore = "_" VarID = "ID" VarGUID = "GUID" VarName = "Name" VarStatus = "Status" // Имена тегов полей в описании query параметров TagJSON = "json" TagDB = db.TagDB // Database field definition TagDBAlt = db.TagDBAlt // Database field definition (alternative) TagDefault = db.TagDefault // default value TagSample = "sample" // Sample field value TagComment = "comment" // Field comment TagRequired = "required" // Is field required TagReadonly = "readonly" // Is field readonly TagRole = "role" // Field role (see Role* below) TagRef = "ref" // OpenAPI ref TagEnum = "enum" // OpenAPI enum content TagOA = "oa" // OpenAPI name TagOAtype = "oaType" // OpenAPI type TagOAformat = "oaFormat" // OpenAPI format RolePrimary = "primary" RoleKey = "key" StdPrimaryField = VarID DefaultValueNull = db.DefaultValueNull )
Variables ¶
This section is empty.
Functions ¶
func GetKnownObjects ¶
func SaveObject ¶
Types ¶
type Chain ¶
type Chain struct { Parent *Chains `json:"-"` Flags Flags `json:"flags,omitempty"` Summary string `json:"summary"` Description string `json:"description"` Name string `json:"name"` Scope string `json:"scope,omitempty"` Params Params `json:"params"` Tokens []*Token `json:"tokens"` CacheLifetime config.Duration `json:"cacheLifetime"` // Время жизни кэша, если 0, то не использовать }
type Chains ¶
type Chains struct { Summary string `json:"summary"` Description string `json:"description"` ParamsDescription string `json:"paramsDescription"` Chains ChainsList `json:"chains"` StdParams Params `json:"params"` DefaultHttpCode int `json:"defaultHttpCode"` HttpCodes []int `json:"httpCodes"` // contains filtered or unexported fields }
type ChainsList ¶
type ChainsList []*Chain
func (ChainsList) Clone ¶
func (chainsList ChainsList) Clone() ChainsList
type Params ¶
type Params struct { Flags Flags `json:"flags,omitempty"` InHeaders misc.StringMap `json:"inHeaders,omitempty"` // name -> description OutHeaders misc.StringMap `json:"outHeaders,omitempty"` // name -> description PathParamsPattern any `json:"pathParams"` PathParamsType reflect.Type `json:"-"` QueryParamsPattern any `json:"queryParams"` QueryParamsType reflect.Type `json:"-"` Request RequestParams `json:"requestParams"` Response ResponseParams `json:"responseParams"` DBFields *db.FieldsList `json:"-"` }
func (*Params) ExtractFieldsFromBody ¶
func (*Params) MakeTypeFlatModel ¶
type ParamsObject ¶
type RequestParams ¶
type RequestParams struct { ParamsObject `json:"object"` FlatModel misc.StringMap `json:"-"` // ключ - путь до поля, значение - db name BlankTemplate misc.InterfaceMap `json:"-"` // Все поля, которые могут быть изменены, заполненные пустыми значениями, ключ - db name RequiredFields misc.StringMap `json:"-"` // обязательные поля, ключ - путь до поля, значение - db name ReadonlyFields misc.StringMap `json:"-"` // поля только на чтение, ключ - путь до поля, значение - db name UniqueKeyFields []string `json:"requestUniqueKeyFields"` // уникальные поля, первый - primary key (формально) }
type ResponseParams ¶
type ResponseParams struct { ParamsObject `json:"object"` SrcPattern any `json:"-"` SrcType reflect.Type `json:"-"` }
type Set ¶
type Set struct { Flags Flags `json:"flags,omitempty"` Summary string `json:"summary"` Description string `json:"description"` Methods Methods `json:"methods"` }
type Token ¶
type Vars ¶
type Vars misc.InterfaceMap
Click to show internal directories.
Click to hide internal directories.