TM_EC

package module
v0.0.0-...-d4279f8 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2017 License: MIT Imports: 3 Imported by: 2

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
}

type Context

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

'Context' is ec context, which is used for many ec components, used to share infoation 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 ec admin to get current logged user

type Errors

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

func (*Errors) AddError

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

func (Errors) Error

func (errs Errors) Error() string

func (Errors) GetErrors

func (errs Errors) GetErrors() []error

'GetErrors'

func (Errors) HasError

func (errs Errors) HasError() bool

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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