adsa-cms: github.com/mmanjoura/adsa-cms/qor Index | Files | Directories

package qor

import "github.com/mmanjoura/adsa-cms/qor"

Index

Package Files

config.go context.go errors.go

type Config Uses

type Config struct {
    DB *gorm.DB
}

Config qor config struct

type Context Uses

type Context struct {
    Request     *http.Request
    Writer      http.ResponseWriter
    ResourceID  string
    Config      *Config
    Roles       []string
    DB          *gorm.DB
    CurrentUser CurrentUser
    Errors
}

Context qor context, which is used for many qor components, used to share information between them

func (*Context) Clone Uses

func (context *Context) Clone() *Context

Clone clone current context

func (*Context) GetDB Uses

func (context *Context) GetDB() *gorm.DB

GetDB get db from current context

func (*Context) SetDB Uses

func (context *Context) SetDB(db *gorm.DB)

SetDB set db into current context

type CurrentUser Uses

type CurrentUser interface {
    DisplayName() string
}

CurrentUser is an interface, which is used for qor admin to get current logged user

type Errors Uses

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

Errors is a struct that used to hold errors array

func (*Errors) AddError Uses

func (errs *Errors) AddError(errors ...error)

AddError add error to Errors struct

func (Errors) Error Uses

func (errs Errors) Error() string

Error get formatted error message

func (Errors) GetErrors Uses

func (errs Errors) GetErrors() []error

GetErrors return error array

func (Errors) HasError Uses

func (errs Errors) HasError() bool

HasError return has error or not

Directories

PathSynopsis
resource
test/utils
utils

Package qor imports 3 packages (graph) and is imported by 23 packages. Updated 2017-06-16. Refresh now. Tools for package owners.