Documentation ¶
Index ¶
- Constants
- Variables
- func FormConditionClause(dbSchema string, scope string, domainName string, ...) (clause.Clause, error)
- func HasRule(dbSchema string, scope string, domainName string, ...) (bool, error)
- type AddQueryRuleJsonBody
- type DisableQueryRuleJsonBody
- type EnableQueryRuleJsonBody
- type Entity
- type GetEnabledQueryRuleQueryParams
- type GetQueryRulesQueryParams
- type Info
- type RemoveQueryRuleQueryParams
- type Rule
- type Simple
Constants ¶
View Source
const ( FieldScope = "Scope" FieldDomainName = "DomainName" FieldRule = "Rule" FieldEnabled = "Enabled" )
View Source
const ( LogicalOperatorAnd = "and" LogicalOperatorOr = "or" )
Variables ¶
View Source
var ( ColumnScope = domain.ColumnName(FieldScope) ColumnDomainName = domain.ColumnName(FieldDomainName) ColumnRule = domain.ColumnName(FieldRule) ColumnEnabled = domain.ColumnName(FieldEnabled) )
Functions ¶
func FormConditionClause ¶
func FormConditionClause(dbSchema string, scope string, domainName string, i *infrastructure.Infrastructure, ruleParams map[string]any) (clause.Clause, error)
FormConditionClause 获取规则并返回条件语句 参数: - dbSchema: 数据库schema - scope: 范围 - domainName: 领域名称 - i: 基础设施 - ruleParams: 规则参数 返回值: - 语句接口,当错误为nil时,语句接口也可能是nil,代表该规则并没有被赋值,所以是没有条件的 - 错误
func HasRule ¶
func HasRule(dbSchema string, scope string, domainName string, i *infrastructure.Infrastructure) (bool, error)
HasRule 检查是否存在规则 参数: - dbSchema: 数据库schema - scope: 范围 - domainName: 领域名称 - i: 基础设施 返回值: - 是否存在规则 - 错误
Types ¶
type AddQueryRuleJsonBody ¶
type DisableQueryRuleJsonBody ¶
type DisableQueryRuleJsonBody struct {
request.IDJsonBody
}
type EnableQueryRuleJsonBody ¶
type EnableQueryRuleJsonBody struct {
request.IDJsonBody
}
type Entity ¶
type Entity struct { entity.Base Scope string `sqlmapping:"column:scope;notUpdate;" sqlresult:"column:scope;" check:"required,lte=256,when=create"` DomainName string `sqlmapping:"column:domain_name;notUpdate;" sqlresult:"column:domain_name;" check:"required,lte=256,when=create"` Rule string `sqlmapping:"column:rule;notUpdate;" sqlresult:"column:rule;" check:"required,when=create"` Enabled bool `sqlresult:"column:enabled;" sqlresult:"column:enabled;"` }
func (*Entity) DomainCNName ¶
func (*Entity) DomainCamelName ¶
func (*Entity) GetFieldMap ¶ added in v1.1.0
type Info ¶
type Info struct { application.InfoIDField Scope string `json:"scope" sqlresult:"column:scope"` DomainName string `json:"domainName" sqlresult:"column:domain_name"` Rule string `json:"rule" sqlresult:"column:rule"` Enabled bool `json:"enabled" sqlresult:"column:enabled"` }
type RemoveQueryRuleQueryParams ¶
type RemoveQueryRuleQueryParams struct {
request.IDQueryParam
}
Click to show internal directories.
Click to hide internal directories.