Documentation ¶
Index ¶
- Constants
- Variables
- func AddComponent(name string, conf camStatics.ComponentConfigInterface)
- func Debug(title, content string)
- func Env(key string) string
- func Error(title, content string)
- func Fatal(title, content string)
- func Info(title, content string)
- func NewAppConfig() *camConfig.AppConfig
- func NewCacheConfig() *camCache.CacheComponentConfigdeprecated
- func NewCamManager() *cmd.CamManager
- func NewConfig() *camConfig.Configdeprecated
- func NewConsoleConfig() *camConsole.ConsoleComponentConfigdeprecated
- func NewDatabaseConfig(driverName string, host string, port string, name string, username string, ...) *camDatabase.DatabaseComponentConfigdeprecated
- func NewFileCache() *camCache.FileCachedeprecated
- func NewHttpConfig(port uint16) *camHttp.HttpComponentConfigdeprecated
- func NewLogConfig() *camLog.LogComponentConfigdeprecated
- func NewMailConfig(email string, password string, host string) *camMail.MailComponentConfigdeprecated
- func NewRecover(message string) *camStructs.Recoverdeprecated
- func NewRedisCache() *camCache.RedisCachedeprecated
- func NewRule(fields []string, handlers ...camStatics.ValidHandler) *camStructs.Ruledeprecated
- func NewSocketConfig(port uint16) *camSocket.SocketComponentConfigdeprecated
- func NewValidationConfig() *camValidation.ValidationComponentConfigdeprecated
- func NewWebsocketConfig(port uint16) *camWebsocket.WebsocketComponentConfigdeprecated
- func Param(key string) interface{}
- func RegisterController(ctrl camStatics.ControllerInterface)
- func RunDefault()
- func Trace(title, content string)
- func Valid(v interface{}) (firstErr error, errDict map[string][]error)
- func Version() string
- func Warn(title, content string)
- type Application
- func (app *Application) AddComponentAfterRun(name string, conf camStatics.ComponentConfigInterface) camStatics.ComponentInterface
- func (app *Application) AddConfig(configI camStatics.AppConfigInterface)
- func (app *Application) AddMigration(m camStatics.MigrationInterface)
- func (app *Application) AfterInit(handler func())
- func (app *Application) AfterStart(handler func())
- func (app *Application) AfterStop(handler func())
- func (app *Application) BeforeInit(handler func())
- func (app *Application) BeforeStart(handler func())
- func (app *Application) BeforeStop(handler func())
- func (app *Application) Debug(title string, content string)
- func (app *Application) Error(title string, content string)
- func (app *Application) Fatal(title string, content string)
- func (app *Application) GetCache() camStatics.CacheComponentInterface
- func (app *Application) GetComponent(v camStatics.ComponentInterface) camStatics.ComponentInterface
- func (app *Application) GetComponentByName(name string) camStatics.ComponentInterface
- func (app *Application) GetDB() camStatics.DatabaseComponentInterface
- func (app *Application) GetEvn(key string) string
- func (app *Application) GetGrpcClientConn(name string) *grpc.ClientConn
- func (app *Application) GetMail() camStatics.MailComponentInterface
- func (app *Application) GetMigrateDict() map[string]camStatics.MigrationInterface
- func (app *Application) GetParam(key string) interface{}
- func (app *Application) Info(title string, content string)
- func (app *Application) Run()
- func (app *Application) Stop()
- func (app *Application) Trace(title string, content string)
- func (app *Application) Valid(v interface{}) (firstErr error, errDict map[string][]error)
- func (app *Application) Warn(title string, content string)
- type ConstantControllerdeprecated
- type Contextdeprecated
- type Controllerdeprecated
- type ControllerActiondeprecated
- type HttpControllerdeprecated
- type MiddlewareInterfacedeprecated
- type ValidInterfacedeprecated
Constants ¶
const ( // Deprecated: Remove on v0.6.0 instead by camStatics.* LogLevelTrace = camStatics.LogLevelTrace // log level: trace // Deprecated: Remove on v0.6.0 instead by camStatics.* LogLevelDebug = camStatics.LogLevelDebug // log level: debug // Deprecated: Remove on v0.6.0 instead by camStatics.* LogLevelInfo = camStatics.LogLevelInfo // log level: info // Deprecated: Remove on v0.6.0 instead by camStatics.* LogLevelWarn = camStatics.LogLevelWarn // log level: warning // Deprecated: Remove on v0.6.0 instead by camStatics.* LogLevelError = camStatics.LogLevelError // log level: error // Deprecated: Remove on v0.6.0 instead by camStatics.* LogLevelFatal = camStatics.LogLevelFatal // log level: fatal // Deprecated: Remove on v0.6.0 instead by camStatics.* LogLevelNone = camStatics.LogLevelNone // none // Deprecated: Remove on v0.6.0 instead by camStatics.* LogLevelSuggest = camStatics.LogLevelSuggest // suggest this level to write file // Deprecated: Remove on v0.6.0 instead by camStatics.* LogLevelAll = camStatics.LogLevelAll // all )
Log
const ( // Deprecated: Remove on v0.6.0 instead by camStatics.* ValidModeInterface = camStatics.ModeInterface // Interface mode // Deprecated: Remove on v0.6.0 instead by camStatics.* ValidModeTag = camStatics.ModeTag // Tag mode // Deprecated: Remove on v0.6.0 instead by camStatics.* ValidModeBot = camStatics.ModeBoth // Interface and Tag mode )
Validation
Variables ¶
var Rule = camValidation.Rule
#################### [START] instance export ####################
Functions ¶
func AddComponent ¶ added in v0.4.0
func AddComponent(name string, conf camStatics.ComponentConfigInterface)
must run before cam.RunDefault
func NewCacheConfig
deprecated
added in
v0.3.0
func NewCacheConfig() *camCache.CacheComponentConfig
Deprecated: Remove on v0.6.0 new cacheComp config
func NewCamManager ¶ added in v0.5.0
func NewCamManager() *cmd.CamManager
func NewConsoleConfig
deprecated
func NewConsoleConfig() *camConsole.ConsoleComponentConfig
Deprecated: Remove on v0.6.0 new ConsoleComponent config
func NewDatabaseConfig
deprecated
func NewDatabaseConfig(driverName string, host string, port string, name string, username string, password string) *camDatabase.DatabaseComponentConfig
Deprecated: Remove on v0.6.0 new DatabaseComponent config
func NewFileCache
deprecated
added in
v0.3.0
func NewHttpConfig
deprecated
added in
v0.3.0
func NewHttpConfig(port uint16) *camHttp.HttpComponentConfig
Deprecated: Remove on v0.6.0 new ConsoleComponent config
func NewLogConfig
deprecated
added in
v0.2.16
func NewLogConfig() *camLog.LogComponentConfig
Deprecated: Remove on v0.6.0 new log config
func NewMailConfig
deprecated
added in
v0.3.0
func NewMailConfig(email string, password string, host string) *camMail.MailComponentConfig
Deprecated: Remove on v0.6.0
func NewRecover
deprecated
added in
v0.3.0
func NewRecover(message string) *camStructs.Recover
Deprecated: Remove on v0.6.0
func NewRedisCache
deprecated
added in
v0.3.0
func NewRedisCache() *camCache.RedisCache
Deprecated: Remove on v0.6.0 new redis engine
func NewRule
deprecated
added in
v0.4.0
func NewRule(fields []string, handlers ...camStatics.ValidHandler) *camStructs.Rule
Deprecated: Remove on v0.6.0 new rule
func NewSocketConfig
deprecated
added in
v0.4.0
func NewSocketConfig(port uint16) *camSocket.SocketComponentConfig
Deprecated: Remove on v0.6.0 new SocketComponentConfig
func NewValidationConfig
deprecated
added in
v0.4.0
func NewValidationConfig() *camValidation.ValidationComponentConfig
Deprecated: Remove on v0.6.0 new ValidationComponentConfig
func NewWebsocketConfig
deprecated
added in
v0.3.0
func NewWebsocketConfig(port uint16) *camWebsocket.WebsocketComponentConfig
Deprecated: Remove on v0.6.0 new WebsocketComponent config
func RegisterController ¶ added in v0.4.0
func RegisterController(ctrl camStatics.ControllerInterface)
must run before cam.RunDefault register controller
Types ¶
type Application ¶ added in v0.3.0
type Application struct {
// contains filtered or unexported fields
}
framework Application global instance struct define
func (*Application) AddComponentAfterRun ¶ added in v0.4.0
func (app *Application) AddComponentAfterRun(name string, conf camStatics.ComponentConfigInterface) camStatics.ComponentInterface
add component after app ran
func (*Application) AddConfig ¶ added in v0.3.0
func (app *Application) AddConfig(configI camStatics.AppConfigInterface)
Add config. Must be called before calling cam.App.Run (). Merge as much as possible, otherwise overwrite.
config: new config
func (*Application) AddMigration ¶ added in v0.3.0
func (app *Application) AddMigration(m camStatics.MigrationInterface)
add migration struct
func (*Application) AfterInit ¶ added in v0.5.0
func (app *Application) AfterInit(handler func())
func (*Application) AfterStart ¶ added in v0.5.0
func (app *Application) AfterStart(handler func())
func (*Application) AfterStop ¶ added in v0.5.0
func (app *Application) AfterStop(handler func())
func (*Application) BeforeInit ¶ added in v0.5.0
func (app *Application) BeforeInit(handler func())
func (*Application) BeforeStart ¶ added in v0.5.0
func (app *Application) BeforeStart(handler func())
func (*Application) BeforeStop ¶ added in v0.5.0
func (app *Application) BeforeStop(handler func())
func (*Application) Debug ¶ added in v0.3.0
func (app *Application) Debug(title string, content string)
log debug
func (*Application) Error ¶ added in v0.3.0
func (app *Application) Error(title string, content string)
log error
func (*Application) Fatal ¶ added in v0.3.0
func (app *Application) Fatal(title string, content string)
log fatal
func (*Application) GetCache ¶ added in v0.3.0
func (app *Application) GetCache() camStatics.CacheComponentInterface
get cacheComp component
func (*Application) GetComponent ¶ added in v0.3.0
func (app *Application) GetComponent(v camStatics.ComponentInterface) camStatics.ComponentInterface
Overwrite: Try to get instance using struct type
func (*Application) GetComponentByName ¶ added in v0.3.0
func (app *Application) GetComponentByName(name string) camStatics.ComponentInterface
Overwrite: Try to get component instance by name. The name is define in config
func (*Application) GetDB ¶ added in v0.3.0
func (app *Application) GetDB() camStatics.DatabaseComponentInterface
get default db component
func (*Application) GetEvn ¶ added in v0.3.0
func (app *Application) GetEvn(key string) string
get one .evn file values
func (*Application) GetGrpcClientConn ¶ added in v0.5.0
func (app *Application) GetGrpcClientConn(name string) *grpc.ClientConn
func (*Application) GetMail ¶ added in v0.3.0
func (app *Application) GetMail() camStatics.MailComponentInterface
get mail component
func (*Application) GetMigrateDict ¶ added in v0.3.0
func (app *Application) GetMigrateDict() map[string]camStatics.MigrationInterface
func (*Application) GetParam ¶ added in v0.3.0
func (app *Application) GetParam(key string) interface{}
get value form app.config.Params.
func (*Application) Info ¶ added in v0.3.0
func (app *Application) Info(title string, content string)
log info
func (*Application) Trace ¶ added in v0.3.0
func (app *Application) Trace(title string, content string)
log trace
func (*Application) Valid ¶ added in v0.4.0
func (app *Application) Valid(v interface{}) (firstErr error, errDict map[string][]error)
validComp struct
func (*Application) Warn ¶ added in v0.3.0
func (app *Application) Warn(title string, content string)
log warning
type ConstantController
deprecated
added in
v0.3.0
type ConstantController struct {
camConsole.ConsoleController
}
Deprecated: Remove on v0.6.0
type Context
deprecated
added in
v0.3.0
type Context struct {
camContext.Context
}
Deprecated: Remove on v0.6.0
type Controller
deprecated
added in
v0.3.0
type Controller struct {
camRouter.Controller
}
Deprecated: Remove on v0.6.0
type ControllerAction
deprecated
added in
v0.3.0
type ControllerAction struct {
camRouter.ControllerAction
}
Deprecated: Remove on v0.6.0
type HttpController
deprecated
added in
v0.3.0
type HttpController struct {
camHttp.HttpController
}
Deprecated: Remove on v0.6.0
type MiddlewareInterface
deprecated
added in
v0.4.1
type MiddlewareInterface interface { camStatics.MiddlewareInterface }
Deprecated: Remove on v0.6.0
type ValidInterface
deprecated
added in
v0.4.0
type ValidInterface interface { camStatics.ValidInterface }
Deprecated: Remove on v0.6.0
Directories ¶
Path | Synopsis |
---|---|
base
|
|
camMail
From: https://github.com/jordan-wright/email Datetime: 2020-03-09 17:28:00 From: https://github.com/jordan-wright/email Datetime: 2020-03-09 17:28:00
|
From: https://github.com/jordan-wright/email Datetime: 2020-03-09 17:28:00 From: https://github.com/jordan-wright/email Datetime: 2020-03-09 17:28:00 |