example

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	ID        uint64         `gorm:"column:id;primaryKey"   json:"id,omitempty"`
	CreatedAt time.Time      `gorm:"column:created_at"      json:"created_at,omitempty"`
	UpdatedAt time.Time      `gorm:"column:updated_at"      json:"updated_at,omitempty"`
	DeletedAt gorm.DeletedAt `gorm:"column:delete_at;index" json:"-"`
	Name      string         `gorm:"column:name;unique"     json:"name,omitempty"`
}

Domain sample for caskin.Domain interface

func (*Domain) Decode

func (d *Domain) Decode(code string) error

func (*Domain) Encode

func (d *Domain) Encode() string

func (*Domain) GetID

func (d *Domain) GetID() uint64

func (*Domain) SetID

func (d *Domain) SetID(id uint64)

type Object

type Object struct {
	ID        uint64         `gorm:"column:id;primaryKey"                     json:"id,omitempty"`
	CreatedAt time.Time      `gorm:"column:created_at"                        json:"created_at,omitempty"`
	UpdatedAt time.Time      `gorm:"column:updated_at"                        json:"updated_at,omitempty"`
	DeletedAt gorm.DeletedAt `gorm:"column:delete_at;index"                   json:"-"`
	Name      string         `gorm:"column:name;index:idx_object,unique"      json:"name,omitempty"`
	Type      string         `gorm:"column:type"                              json:"type,omitempty"`
	DomainID  uint64         `gorm:"column:domain_id;index:idx_object,unique" json:"domain_id,omitempty"`
	ParentID  uint64         `gorm:"column:parent_id;index:idx_object,unique" json:"parent_id"`
}

Object sample for caskin.Object interface

func (*Object) Decode

func (o *Object) Decode(code string) error

func (*Object) Encode

func (o *Object) Encode() string

func (*Object) GetDomainID

func (o *Object) GetDomainID() uint64

func (*Object) GetID

func (o *Object) GetID() uint64

func (*Object) GetObjectType

func (o *Object) GetObjectType() string

func (*Object) GetParentID

func (o *Object) GetParentID() uint64

func (*Object) SetDomainID

func (o *Object) SetDomainID(did uint64)

func (*Object) SetID

func (o *Object) SetID(id uint64)

func (*Object) SetParentID

func (o *Object) SetParentID(pid uint64)

type OneObjectData

type OneObjectData struct {
	ID        uint64         `gorm:"column:id;primaryKey"   json:"id,omitempty"`
	CreatedAt time.Time      `gorm:"column:created_at"      json:"created_at,omitempty"`
	UpdatedAt time.Time      `gorm:"column:updated_at"      json:"updated_at,omitempty"`
	DeletedAt gorm.DeletedAt `gorm:"column:delete_at;index" json:"-"`
	Name      string         `gorm:"column:name"            json:"name,omitempty"`
	DomainID  uint64         `gorm:"column:domain_id"       json:"domain_id,omitempty"`
	ObjectID  uint64         `gorm:"column:object_id"       json:"object_id,omitempty"`
}

OneObjectData one kind of object_data

func (*OneObjectData) GetDomainID

func (o *OneObjectData) GetDomainID() uint64

func (*OneObjectData) GetID

func (o *OneObjectData) GetID() uint64

func (*OneObjectData) GetObjectID added in v0.1.0

func (o *OneObjectData) GetObjectID() uint64

func (*OneObjectData) SetDomainID

func (o *OneObjectData) SetDomainID(did uint64)

func (*OneObjectData) SetID

func (o *OneObjectData) SetID(id uint64)

func (*OneObjectData) SetObjectID

func (o *OneObjectData) SetObjectID(oid uint64)

type Role

type Role struct {
	ID        uint64         `gorm:"column:id;primaryKey"                   json:"id,omitempty"`
	CreatedAt time.Time      `gorm:"column:created_at"                      json:"created_at,omitempty"`
	UpdatedAt time.Time      `gorm:"column:updated_at"                      json:"updated_at,omitempty"`
	DeletedAt gorm.DeletedAt `gorm:"column:delete_at;index"                 json:"-"`
	Name      string         `gorm:"column:name;index:idx_role,unique"      json:"name,omitempty"`
	DomainID  uint64         `gorm:"column:domain_id;index:idx_role,unique" json:"domain_id,omitempty"`
	ObjectID  uint64         `gorm:"column:object_id;index:idx_role,unique" json:"object_id,omitempty"`
}

Role sample for caskin.Role interface

func (*Role) Decode

func (r *Role) Decode(code string) error

func (*Role) Encode

func (r *Role) Encode() string

func (*Role) GetDomainID

func (r *Role) GetDomainID() uint64

func (*Role) GetID

func (r *Role) GetID() uint64

func (*Role) GetObjectID added in v0.1.0

func (r *Role) GetObjectID() uint64

func (*Role) SetDomainID

func (r *Role) SetDomainID(did uint64)

func (*Role) SetID

func (r *Role) SetID(id uint64)

func (*Role) SetObjectID

func (r *Role) SetObjectID(objectId uint64)

type User

type User struct {
	ID        uint64         `gorm:"column:id;primaryKey"       json:"id,omitempty"`
	CreatedAt time.Time      `gorm:"column:created_at"          json:"created_at,omitempty"`
	UpdatedAt time.Time      `gorm:"column:updated_at"          json:"updated_at,omitempty"`
	DeletedAt gorm.DeletedAt `gorm:"column:delete_at;index"     json:"-"`
	Email     string         `gorm:"column:email;unique"        json:"email,omitempty"`
}

User sample for caskin.User interface

func (*User) Decode

func (u *User) Decode(code string) error

func (*User) Encode

func (u *User) Encode() string

func (*User) GetID

func (u *User) GetID() uint64

func (*User) SetID

func (u *User) SetID(id uint64)

Jump to

Keyboard shortcuts

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