roles

package
v0.0.0-...-db28b0c Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Unlicense Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const EndPoint = "roles"

Variables

This section is empty.

Functions

func Create

func Create(ctx *app.Ctx, param *ParamCreate) error

func CreateHandler

func CreateHandler(c *fiber.Ctx) error

func DeleteByID

func DeleteByID(ctx *app.Ctx, id string, param ParamDelete) error

func DeleteByIDHandler

func DeleteByIDHandler(c *fiber.Ctx) error

func Get

func Get(ctx *app.Ctx, query url.Values) (app.ListModel, error)

func GetACLKeysHandler

func GetACLKeysHandler(c *fiber.Ctx) error

func GetByIDHandler

func GetByIDHandler(c *fiber.Ctx) error

func GetListHandler

func GetListHandler(c *fiber.Ctx) error

func PartialyUpdateByID

func PartialyUpdateByID(ctx *app.Ctx, id string, param *ParamPartialyUpdate) error

func PartialyUpdateByIDHandler

func PartialyUpdateByIDHandler(c *fiber.Ctx) error

func UpdateByID

func UpdateByID(ctx *app.Ctx, id string, param *ParamUpdate) error

func UpdateByIDHandler

func UpdateByIDHandler(c *fiber.Ctx) error

Types

type AclKeys

type AclKeys struct {
	db.NullJSON
	Data map[string]bool
}

type List

type List struct {
	app.ListModel
	Results []Role `json:"results"`
}

type ParamCreate

type ParamCreate struct {
	Role
}

type ParamDelete

type ParamDelete struct {
	Role
	Reason db.NullString `json:"reason" gorm:"-" validate:"required" form:"reason"`
}

type ParamPartialyUpdate

type ParamPartialyUpdate struct {
	Role
	Reason db.NullString `json:"reason" gorm:"-" validate:"required" form:"reason"`
}

type ParamUpdate

type ParamUpdate struct {
	ParamCreate
	Reason db.NullString `json:"reason" gorm:"-" validate:"required" form:"reason"`
}

type Role

type Role struct {
	db.Model
	ID          db.NullInt64  `json:"id"          db:"g.id"            gorm:"column:id;primaryKey"`
	Name        db.NullString `json:"name"        db:"g.name"          gorm:"column:name"`
	IsAdmin     db.NullBool   `json:"is_admin"    db:"g.is_admin"      gorm:"column:is_admin"`
	Description db.NullString `json:"description" db:"g.description"   gorm:"column:description"`
	AclKeys     AclKeys       `json:"acl"         db:"g.acl_keys~json" gorm:"column:acl_keys"`
}

func GetByID

func GetByID(ctx *app.Ctx, id string, query url.Values) (Role, error)

func (*Role) SetFilter

func (g *Role) SetFilter()

func (*Role) SetRelation

func (g *Role) SetRelation()

func (*Role) SetSort

func (g *Role) SetSort()

func (Role) TableAliasName

func (Role) TableAliasName() string

func (Role) TableName

func (Role) TableName() string

func (Role) TableVersion

func (Role) TableVersion() string

Jump to

Keyboard shortcuts

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