qor

package module
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 3 Imported by: 38

README

QOR

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB *gorm.DB
}

Config qor config struct

type Context

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

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

func (*Context) Clone

func (context *Context) Clone() *Context

Clone clone current context

func (*Context) GetDB

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

GetDB get db from current context

func (*Context) SetDB

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

SetDB set db into current context

type CurrentUser

type CurrentUser interface {
	DisplayName() string
}

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

type Errors

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

Errors is a struct that used to hold errors array

func (*Errors) AddError

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

AddError add error to Errors struct

func (Errors) Error

func (errs Errors) Error() string

Error get formatted error message

func (Errors) GetErrors

func (errs Errors) GetErrors() []error

GetErrors return error array

func (Errors) HasError

func (errs Errors) HasError() bool

HasError return has error or not

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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