model

package
v0.0.0-...-6120cfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTableNotExists = errors.New("table not exits")

Functions

func GenerateEffectPolicyAst

func GenerateEffectPolicyAst(policyTable, eftColumnName, allow, deny string, policyType EffectPolicyType) []ast.Evaluable

func NewIndexSchemaReader

func NewIndexSchemaReader(info *TableInfo, indexIdx int) bschema.Reader

Types

type CIStr

type CIStr struct {
	O string
	L string
}

CIStr is case insensitive string.

type Cloneable

type Cloneable interface {
	Clone() Cloneable
}

type ColumnInfo

type ColumnInfo struct {
	ID              uint64
	ColName         CIStr
	Offset          int
	Tp              bsontype.Type
	DefaultValue    Cloneable
	DefaultValueBit []byte
}

func (*ColumnInfo) Clone

func (c *ColumnInfo) Clone() *ColumnInfo

func (*ColumnInfo) GetDefaultValue

func (c *ColumnInfo) GetDefaultValue() []byte

func (*ColumnInfo) Name

func (c *ColumnInfo) Name() []byte

func (*ColumnInfo) Type

func (c *ColumnInfo) Type() bsontype.Type

type DBInfo

type DBInfo struct {
	ID          uint64
	Name        CIStr
	TableInfo   []*TableInfo
	MatcherInfo []*MatcherInfo
}

func (*DBInfo) Clone

func (d *DBInfo) Clone() *DBInfo

func (*DBInfo) TableById

func (d *DBInfo) TableById(id uint64) (*TableInfo, error)

func (*DBInfo) TableByLName

func (d *DBInfo) TableByLName(name string) (*TableInfo, error)

type EffectPolicyType

type EffectPolicyType uint8
const (
	AllowOverride EffectPolicyType = iota
	DenyOverride
	AllowAndDeny
	Priority
	PriorityBaseOnRole
)

type FKInfo

type FKInfo struct {
	ID       uint64
	Name     CIStr
	RefTable CIStr
	RefCols  []CIStr
	Cols     []CIStr
	OnDelete int64
	OnUpdate int64
}

func (*FKInfo) Clone

func (f *FKInfo) Clone() *FKInfo

type IndexColumn

type IndexColumn struct {
	ColName CIStr
	Offset  int
}

func (*IndexColumn) Clone

func (i *IndexColumn) Clone() *IndexColumn

type IndexInfo

type IndexInfo struct {
	ID      uint64
	Name    CIStr
	Table   CIStr
	Columns []*IndexColumn
	Unique  bool
	Primary bool
	Tp      IndexType
}

func (*IndexInfo) Clone

func (i *IndexInfo) Clone() *IndexInfo

func (*IndexInfo) Leftmost

func (i *IndexInfo) Leftmost() *IndexColumn

type IndexSchemaReader

type IndexSchemaReader struct {
	// contains filtered or unexported fields
}

func (IndexSchemaReader) Field

func (i IndexSchemaReader) Field(s string) int

func (IndexSchemaReader) FieldAt

func (i IndexSchemaReader) FieldAt(pos int) bschema.Field

func (IndexSchemaReader) FieldsLen

func (i IndexSchemaReader) FieldsLen() int

type IndexType

type IndexType uint8

type MatcherInfo

type MatcherInfo struct {
	ID           uint64
	Name         CIStr
	Raw          string
	EffectPolicy EffectPolicyType
	Predicate    ast.Evaluable
}

func (*MatcherInfo) Clone

func (m *MatcherInfo) Clone() *MatcherInfo

type TableInfo

type TableInfo struct {
	ID          uint64
	Name        CIStr
	Columns     []*ColumnInfo
	Indices     []*IndexInfo
	ForeignKeys []*FKInfo
}

func (*TableInfo) Clone

func (t *TableInfo) Clone() *TableInfo

func (*TableInfo) Field

func (t *TableInfo) Field(s string) int

func (*TableInfo) FieldAt

func (t *TableInfo) FieldAt(pos int) bschema.Field

func (*TableInfo) FieldsLen

func (t *TableInfo) FieldsLen() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL