app

package
v0.0.0-...-ae1670a Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: MIT Imports: 8 Imported by: 11

Documentation

Index

Constants

View Source
const ERROR_UNKNOWN = 0x1000

Variables

View Source
var Break = errors.New("break")

Functions

func Handle

func Handle(app IApp, task ITask) error

func Load

func Load(app IApp, path string) error

func Obtain

func Obtain(obtain IObtain)

func Recycle

func Recycle(recycle IRecycle)

func ServiceReflectHandle

func ServiceReflectHandle(app IApp, task ITask, service IService) error

Types

type App

type App struct {
}

func (*App) Obtain

func (A *App) Obtain()

func (*App) Recycle

func (A *App) Recycle()

type DBConfig

type DBConfig struct {
	Name         string
	Url          string
	Prefix       string
	MaxIdleConns int
	MaxOpenConns int
	// contains filtered or unexported fields
}

func (*DBConfig) Get

func (C *DBConfig) Get(app IApp) (*sql.DB, error)

func (*DBConfig) Recycle

func (C *DBConfig) Recycle()

type Error

type Error struct {
	Errno  int    `json:"errno,omitempty"`
	Errmsg string `json:"errmsg,omitempty"`
}

func NewError

func NewError(errno int, errmsg string) *Error

func (*Error) Error

func (E *Error) Error() string

type IApp

type IApp interface {
	IObtain
	IRecycle
}

type IObtain

type IObtain interface {
	Obtain()
}

type IRecycle

type IRecycle interface {
	Recycle()
}

type IService

type IService interface {
	Handle(app IApp, task ITask) error
}

type ITask

type ITask interface {
	GetResult() interface{}
}

func NewTask

func NewTask(app IApp, name []string) (ITask, bool)

type InitTask

type InitTask struct {
	Task
}

type Result

type Result struct {
	Error
}

type RunloopTask

type RunloopTask struct {
	Task
}

type Service

type Service struct {
}

func (*Service) Handle

func (S *Service) Handle(app IApp, task ITask) error

type Task

type Task struct {
}

func (*Task) GetResult

func (T *Task) GetResult() interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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