Documentation ¶
Index ¶
- Constants
- type Condition
- type Config
- type FiledPermit
- type Filters
- type Key
- type Limits
- type LimitsRepo
- type Permit
- type PermitQuery
- type PermitRepo
- type Role
- type RoleGrant
- type RoleGrantQuery
- type RoleQuery
- type RoleRantRepo
- type RoleRepo
- type RoleType
- type SchemaProperties
- type SchemaProps
- type SerialExcute
- type SerialRepo
- type SerialScheme
- type SourceType
- type Table
- type TableQuery
- type TableRelation
- type TableRelationQuery
- type TableRelationRepo
- type TableRepo
- type TableSchema
- type TableSchemaQuery
- type TableSchemeRepo
- type UserRole
- type UserRoleQuery
- type UserRoleRepo
- type UserRoles
- type WebSchema
Constants ¶
View Source
const (
RoleInit = "initType"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FiledPermit ¶
type Key ¶
type Key struct { Type string `json:"type,omitempty"` Properties FiledPermit `json:"properties,omitempty"` }
type Limits ¶
type Limits struct { Path string Name string Params FiledPermit Response FiledPermit Condition Condition ResponseAll bool ParamsAll bool }
type LimitsRepo ¶
type LimitsRepo interface { CreatePermit(ctx context.Context, roleID string, limits ...*Limits) error GetPermit(ctx context.Context, roleID, path string) (*Limits, error) DeletePermit(ctx context.Context, roleID string) error DeletePermitByPath(ctx context.Context, roleID, path string) error CreatePerMatch(ctx context.Context, match *UserRoles) error GetPerMatch(ctx context.Context, appID, userID string) (*UserRoles, error) DeletePerMatch(ctx context.Context, appID string) error // Lock 设置分布式锁 Lock(ctx context.Context, key string, val interface{}, ttl time.Duration) (bool, error) // UnLock 解除分布式锁 UnLock(ctx context.Context, key string) error // PerMatchExpire 给某个键设置过期时间 PerMatchExpire(ctx context.Context, key string, ttl time.Duration) error // PermitExpire PermitExpire PermitExpire(ctx context.Context, key string, ttl time.Duration) error ExistsKey(ctx context.Context, key string) bool }
type Permit ¶
type Permit struct { ID string RoleID string Path string Params FiledPermit Response FiledPermit Condition Condition Method string ParamsAll bool ResponseAll bool CreatedAt int64 CreatorID string CreatorName string }
Permit Permit.
type PermitQuery ¶
type PermitRepo ¶
type PermitRepo interface { BatchCreate(db *gorm.DB, form ...*Permit) error Get(db *gorm.DB, roleID, path, method string) (*Permit, error) Delete(db *gorm.DB, query *PermitQuery) error Update(db *gorm.DB, query *PermitQuery, permit *Permit) error List(db *gorm.DB, query *PermitQuery, page, size int) ([]*Permit, int64, error) }
PermitRepo PermitRepo.
type RoleGrantQuery ¶
type RoleRantRepo ¶
type RoleRantRepo interface { BatchCreate(db *gorm.DB, roleGrant ...*RoleGrant) error Get(db *gorm.DB, id string) (*RoleGrant, error) Update(db *gorm.DB, id string, roleGrant *RoleGrant) error Delete(db *gorm.DB, query *RoleGrantQuery) error List(db *gorm.DB, query *RoleGrantQuery, page, size int) ([]*RoleGrant, int64, error) }
RoleRantRepo RoleRantRepo
type RoleRepo ¶
type RoleRepo interface { BatchCreate(db *gorm.DB, role ...*Role) error Get(db *gorm.DB, id string) (*Role, error) Update(db *gorm.DB, id string, role *Role) error Delete(db *gorm.DB, query *RoleQuery) error List(db *gorm.DB, query *RoleQuery, page, size int) ([]*Role, int64, error) }
RoleRepo RoleRepo.
type SchemaProperties ¶
type SchemaProperties map[string]SchemaProps
type SchemaProps ¶
type SchemaProps struct { Title string `json:"title,omitempty"` Required bool `json:"required,omitempty"` Length int `json:"length,omitempty"` Type string `json:"type,omitempty"` ReadOnly bool `json:"read_only,omitempty"` Items *SchemaProps `json:"items,omitempty"` Properties SchemaProperties `json:"properties,omitempty"` }
type SerialRepo ¶
type SerialRepo interface { Create(ctx context.Context, appID, tableID, fieldID string, values map[string]interface{}) error Get(ctx context.Context, appID, tableID, fieldID, field string) string GetAll(ctx context.Context, appID, tableID, fieldID string) map[string]string }
SerialRepo SerialRepo
type SerialScheme ¶
type SerialScheme struct { Bit string `json:"bit"` Value string `json:"value"` Step string `json:"step"` Date string `json:"date"` }
SerialScheme SerialScheme
type Table ¶
type Table struct { // id pk ID string AppID string // table id TableID string // table design json schema Schema WebSchema // table page config json schema Config Config CreatedAt int64 }
Table schema info.
type TableQuery ¶
type TableRelation ¶
type TableRelationQuery ¶
type TableRelationRepo ¶
type TableRelationRepo interface { BatchCreate(db *gorm.DB, table ...*TableRelation) error Find(db *gorm.DB, query *TableRelationQuery) ([]*TableRelation, error) Update(db *gorm.DB, tableID, fieldName string, table *TableRelation) error Delete(db *gorm.DB, query *TableRelationQuery) error Get(db *gorm.DB, tableID, fieldName string) (*TableRelation, error) List(db *gorm.DB, query *TableRelationQuery, page, size int) ([]*TableRelation, int64, error) }
type TableRepo ¶
type TableRepo interface { BatchCreate(db *gorm.DB, tables ...*Table) error Get(db *gorm.DB, appId, tableID string) (*Table, error) Find(db *gorm.DB, query *TableQuery) ([]*Table, error) Delete(db *gorm.DB, query *TableQuery) error Update(db *gorm.DB, appID, tableID string, table *Table) error List(db *gorm.DB, query *TableQuery, page, size int) ([]*Table, int64, error) }
type TableSchema ¶
type TableSchema struct { ID string AppID string TableID string FieldLen int64 Title string Description string Source SourceType CreatedAt int64 UpdatedAt int64 CreatorID string CreatorName string EditorID string EditorName string Schema SchemaProperties }
TableSchema TableSchema.
type TableSchemaQuery ¶
type TableSchemaQuery struct { TableID string AppID string Title string SourceType SourceType }
type TableSchemeRepo ¶
type TableSchemeRepo interface { BatchCreate(db *gorm.DB, schema ...*TableSchema) error Get(db *gorm.DB, appID, tableID string) (*TableSchema, error) Delete(db *gorm.DB, query *TableSchemaQuery) error Update(db *gorm.DB, appID, tableID string, baseSchema *TableSchema) error List(db *gorm.DB, query *TableSchemaQuery, page, size int) ([]*TableSchema, int64, error) }
type UserRoleQuery ¶
type UserRoleRepo ¶
type UserRoleRepo interface { BatchCreate(db *gorm.DB, userRole ...*UserRole) error Get(db *gorm.DB, appID, userID string) (*UserRole, error) Delete(db *gorm.DB, query *UserRoleQuery) error List(db *gorm.DB, query *UserRoleQuery, page, size int) ([]*UserRole, int64, error) }
UserRoleRepo UserRoleRepo.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.