support

package
v0.0.0-...-aac29df Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//start web. This is the default mode.
	MODE_WEB     = "web"
	MODE_VERSION = "version"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BambooApplication

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

func (*BambooApplication) HandleVersion

func (this *BambooApplication) HandleVersion()

fetch the application version

func (*BambooApplication) HandleWeb

func (this *BambooApplication) HandleWeb()

func (*BambooApplication) Start

func (this *BambooApplication) Start()

Start the application.

type BambooConfig

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

func (*BambooConfig) FinishInstall

func (this *BambooConfig) FinishInstall(mysqlPort int, mysqlHost string, mysqlSchema string, mysqlUsername string, mysqlPassword string)

Finish the installation. Write config to bamboo.json

func (*BambooConfig) Init

func (this *BambooConfig) Init()

func (*BambooConfig) Installed

func (this *BambooConfig) Installed() bool

whether installed.

func (*BambooConfig) MysqlUrl

func (this *BambooConfig) MysqlUrl() string

mysql url

func (*BambooConfig) ReadFromConfigFile

func (this *BambooConfig) ReadFromConfigFile()

func (*BambooConfig) ServerPort

func (this *BambooConfig) ServerPort() int

server port

type BambooContext

type BambooContext struct {

	//session cache
	SessionCache *cache.Table
	//bean map.
	BeanMap map[string]core.Bean
	//controller map
	ControllerMap map[string]core.Controller
	//router
	Router *BambooRouter
	// contains filtered or unexported fields
}

func (*BambooContext) Cleanup

func (this *BambooContext) Cleanup()

func (*BambooContext) CloseDb

func (this *BambooContext) CloseDb()

func (*BambooContext) Destroy

func (this *BambooContext) Destroy()

func (*BambooContext) GetBean

func (this *BambooContext) GetBean(bean core.Bean) core.Bean

func (*BambooContext) GetControllerMap

func (this *BambooContext) GetControllerMap() map[string]core.Controller

func (*BambooContext) GetDB

func (this *BambooContext) GetDB() *gorm.DB

func (*BambooContext) GetSessionCache

func (this *BambooContext) GetSessionCache() *cache.Table

func (*BambooContext) Init

func (this *BambooContext) Init()

func (*BambooContext) InstallOk

func (this *BambooContext) InstallOk()

if application installed. invoke this method.

func (*BambooContext) OpenDb

func (this *BambooContext) OpenDb()

func (*BambooContext) ServeHTTP

func (this *BambooContext) ServeHTTP(writer http.ResponseWriter, request *http.Request)

can serve as http server.

type BambooLogger

type BambooLogger struct {
	//lock. when maintaining, cannot write
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*BambooLogger) Debug

func (this *BambooLogger) Debug(format string, v ...interface{})

func (*BambooLogger) Destroy

func (this *BambooLogger) Destroy()

func (*BambooLogger) Error

func (this *BambooLogger) Error(format string, v ...interface{})

func (*BambooLogger) Info

func (this *BambooLogger) Info(format string, v ...interface{})

func (*BambooLogger) Init

func (this *BambooLogger) Init()

func (*BambooLogger) Log

func (this *BambooLogger) Log(prefix string, format string, v ...interface{})

uniform log method

func (*BambooLogger) Panic

func (this *BambooLogger) Panic(format string, v ...interface{})

func (*BambooLogger) Warn

func (this *BambooLogger) Warn(format string, v ...interface{})

type BambooRouter

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

func NewRouter

func NewRouter() *BambooRouter

func (*BambooRouter) GlobalPanicHandler

func (this *BambooRouter) GlobalPanicHandler(writer http.ResponseWriter, request *http.Request, startTime time.Time)

catch global panic.

func (*BambooRouter) ServeHTTP

func (this *BambooRouter) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type ConfigItem

type ConfigItem struct {
	//server port
	ServerPort int
	//mysql configurations.
	//mysql port
	MysqlPort int
	//mysql host
	MysqlHost string
	//mysql schema
	MysqlSchema string
	//mysql username
	MysqlUsername string
	//mysql password
	MysqlPassword string
}

bamboo.json config items.

Jump to

Keyboard shortcuts

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