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 Method
- 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) FlagCreateReturnsObject = Flags(0x00000008) FlagWithoutCU = Flags(0x00000010) FlagChainDefault = Flags(0x00000001) FlagChainEnableTail = Flags(0x00000002) // VarName VarIgnore = "_" VarID = "ID" VarGUID = "GUID" VarName = "Name" VarStatus = "Status" // Имена тегов полей в описании query параметров TagJSON = "json" TagDB = db.TagDB TagDBAlt = db.TagDBAlt TagSample = "sample" TagComment = "comment" TagRequired = "required" TagReadonly = "readonly" TagRole = "role" TagRef = "ref" TagDefault = "default" TagEnum = "enum" TagOA = "oa" TagOAtype = "oaType" TagOAformat = "oaFormat" RolePrimary = "primary" RoleKey = "key" StdPrimaryField = VarID )
Variables ¶
This section is empty.
Functions ¶
func GetKnownObjects ¶
func SaveObject ¶
Types ¶
type Chain ¶
type Chain struct { Parent *Chains `json:"-"` Flags Flags `json:"flags,omitempty"` 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"` Chains ChainsList `json:"chains"` StdParams Params `json:"params"` // 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 RevFlatModel misc.StringMap `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"` 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.