Documentation ¶
Index ¶
Constants ¶
const ( AppTypeGrpc = 1 AppTypeCron = 2 AppTypeQueue = 3 AppTypeHttp = 4 )
const (
Version = "1.4.0"
)
Variables ¶
var AccessLogger log.LoggerContextIface
AccessLogger is a global vars for application to log access log
var AliRocketMQSetting *setting.AliRocketMQSettingS
AliRocketMQSetting is maps config section "kelvins-queue-ali-rocketmq"
var AppCloseCh = make(chan struct{})
AppCloseCh is app shutdown notice
var BusinessLogger log.LoggerContextIface
BusinessLogger is a global vars for application to log business log
var ErrLogger log.LoggerContextIface
ErrLogger is a global vars for application to log err msg.
var FrameworkLogger log.LoggerContextIface
FrameworkLogger is a global var for Framework log
var GORM_DBEngine *gorm.DB
GORM_DBEngine is a global vars for mysql connect.
var GPool *goroutine.Pool
GPool is goroutine pool
var GPoolSetting *setting.GPoolSettingS
GPoolSetting is maps config section "kelvins-gpool"
var LoggerSetting *setting.LoggerSettingS
LoggerSetting is maps config section "kelvins-logger"
var MongoDBClient *qmgo.QmgoClient
MongoDBClient is qmgo-client for mongodb.
var MongoDBSetting *setting.MongoDBSettingS
MongoDBSetting is maps config section "kelvins-mongodb"
var MysqlSetting *setting.MysqlSettingS
MysqlSetting is maps config section "kelvins-mysql"
var PIDFile string
PIDFile is process pid
var QueueAMQPSetting *setting.QueueAMQPSettingS
QueueAMQPSetting is maps config section "kelvins-queue-amqp"
var QueueAliAMQPSetting *setting.QueueAliAMQPSettingS
QueueAliAMQPSetting is maps config section "kelvins-queue-amqp"
var QueueRedisSetting *setting.QueueRedisSettingS
QueueRedisSetting is maps config section "kelvins-queue-redis"
var QueueServerSetting *setting.QueueServerSettingS
QueueServerSetting is maps config section "kelvins-queue-server"
var RPCAuthSetting *setting.RPCAuthSettingS
ServerAuthSetting is maps config section "kelvins-auth"
var RedisConn *redis.Pool
RedisConn is a global vars for redis connect.
var RedisSetting *setting.RedisSettingS
MysqlSetting is maps config section "kelvins-redis"
var ServerName string
ServerName is server name
var ServerSetting *setting.ServerSettingS
ServerSetting is maps config section "kelvins-server"
var XORM_DBEngine xorm.EngineInterface
XORM_DBEngine is a global vars for mysql connect.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Name string Type int32 LoggerRootPath string LoggerLevel string LoadConfig func() error SetupVars func() error StopFunc func() error }
Application ...
type CronApplication ¶
type CronApplication struct { *Application CronLogger *log.LoggerContext Cron *cron.Cron GenCronJobs func() []*CronJob EventServer *event.EventServer RegisterEventHandler func(event.EventServerIface) error }
CronApplication ...
type CronJob ¶
type CronJob struct { Name string // Job unique name Spec string // Job specification Job func() // Job func }
CronJob warps job define.
type GRPCApplication ¶
type GRPCApplication struct { *Application Port int64 GRPCServer *grpc.Server HealthServer *health.Server DisableHealthCheck bool RegisterHealthServer func(*health.Server) // execute in the coroutine NumServerWorkers uint32 GatewayServeMux *runtime.ServeMux Mux *http.ServeMux HttpServer *http.Server TlsConfig *tls.Config GKelvinsLogger *log.LoggerContext GSysErrLogger *log.LoggerContext UnaryServerInterceptors []grpc.UnaryServerInterceptor StreamServerInterceptors []grpc.StreamServerInterceptor ServerOptions []grpc.ServerOption RegisterGRPCServer func(*grpc.Server) error RegisterGateway func(context.Context, *runtime.ServeMux, string, []grpc.DialOption) error RegisterHttpRoute func(*http.ServeMux) error EventServer *event.EventServer RegisterEventProducer func(event.ProducerIface) error }
GRPCApplication ...
type HTTPApplication ¶
type HTTPApplication struct { *Application Port int64 TraceLogger *log.LoggerContext TlsConfig *tls.Config Mux *http.ServeMux HttpServer *http.Server RegisterHttpRoute func(*http.ServeMux) error RegisterHttpGinEngine func() (*gin.Engine, error) // can over RegisterHttpRoute EventServer *event.EventServer RegisterEventProducer func(event.ProducerIface) error }
HTTPApplication ...
type QueueApplication ¶
type QueueApplication struct { *Application QueueLogger *log.LoggerContext QueueServer *queue.MachineryQueue EventServer *event.EventServer GetNamedTaskFuncs func() map[string]interface{} RegisterEventHandler func(event.EventServerIface) error }
QueueApplication ...