qor: github.com/qor/qor Index | Files | Directories

package qor

import "github.com/qor/qor"


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
    CurrentUser CurrentUser
    Roles       []string
    ResourceID  string
    DB          *gorm.DB
    Config      *Config

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



Package qor imports 3 packages (graph) and is imported by 246 packages. Updated 2020-03-02. Refresh now. Tools for package owners.