Documentation
¶
Index ¶
- func InitCronRankJob(rankJob *RankJob) *cron.Cron
- func NewAliyunClient(env *Env) *sms.Client
- func NewCron(timeout time.Duration, postRankUsecase *usecase.PostRankUsecase) *cron.Cron
- func NewDoubaoChat() chat.Chat
- func NewLocalCache(env *Env) *cache.RistrettoCache
- func NewMinio() file.FileStorage
- func NewOrmDatabase(env *Env) orm.Database
- func NewProducer(env *Env) event.Producer
- func NewRedisCache(env *Env) *cache.RedisCache
- func NewSaramaClient(env *Env) sarama.Client
- type Application
- type CronRankJob
- type Env
- type Job
- type RankJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCronRankJob ¶
func InitCronRankJob(rankJob *RankJob) *cron.Cron
func NewAliyunClient ¶
func NewCron ¶
func NewCron(timeout time.Duration, postRankUsecase *usecase.PostRankUsecase) *cron.Cron
NewCron
func NewDoubaoChat ¶
func NewLocalCache ¶
func NewLocalCache(env *Env) *cache.RistrettoCache
func NewMinio ¶
func NewMinio() file.FileStorage
func NewOrmDatabase ¶
func NewProducer ¶
func NewRedisCache ¶
func NewRedisCache(env *Env) *cache.RedisCache
func NewSaramaClient ¶
Types ¶
type Application ¶
type Application struct { Env *Env //Mongo mongo.Client Orm orm.Database Cache *cache.RedisCache LocalCache *cache.RistrettoCache Producer event.Producer SaramaClient sarama.Client SMSAliyunClient *sms.Client MinioClient file.FileStorage DoubaoChat chat.Chat }
func App ¶
func App() Application
type CronRankJob ¶
type CronRankJob struct {
// contains filtered or unexported fields
}
func NewCronRankJob ¶
func NewCronRankJob(job *RankJob) *CronRankJob
func (*CronRankJob) Run ¶
func (c *CronRankJob) Run()
type Env ¶
type Env struct { AppEnv string `mapstructure:"APP_ENV"` ServerAddr string `mapstructure:"SERVER_ADDR"` ContextTimeout int `mapstructure:"CONTEXT_TIMEOUT"` AccessTokenExpiryHour int `mapstructure:"ACCESS_TOKEN_EXPIRY_HOUR"` RefreshTokenExpiryHour int `mapstructure:"REFRESH_TOKEN_EXPIRY_HOUR"` AccessTokenSecret string `mapstructure:"ACCESS_TOKEN_SECRET"` RefreshTokenSecret string `mapstructure:"REFRESH_TOKEN_SECRET"` RateLimit int `mapstructure:"RATE_LIMIT"` RateLimitWindow int `mapstructure:"RATE_LIMIT_WINDOW"` SnowflakeStartTime string `mapstructure:"SNOWFLAKE_START_TIME"` SnowflakeMachineID int64 `mapstructure:"SNOWFLAKE_MACHINE_ID"` LocalStaticPath string `mapstructure:"LOCAL_STATIC_PATH"` UrlStaticPath string `mapstructure:"URL_STATIC_PATH"` OpenIMServerDoamin string `mapstructure:"OPENIM_SERVER_DOMAIN"` SMSAppID string `mapstructure:"SMS_APP_ID"` SMSSignName string `mapstructure:"SMS_SIGN_NAME"` SMSTemplateID string `mapstructure:"SMS_TEMPLATE_ID"` SMSEndpoint string `mapstructure:"SMS_ENDPOINT"` SMSRegionId string `mapstructure:"SMS_REGION_ID"` MySQLHost string `mapstructure:"MYSQL_HOST"` MySQLPORT string `mapstructure:"MYSQL_PORT"` MySQLUsername string `mapstructure:"MYSQL_USERNAME"` MySQLPassword string `mapstructure:"MYSQL_PASSWORD"` MySQLDB string `mapstructure:"MYSQL_DB"` RedisHost string `mapstructure:"REDIS_HOST"` RedisPort string `mapstructure:"REDIS_PORT"` RedisExpiration int `mapstructure:"REDIS_EXPIRATION"` RedisPassword string `mapstructure:"REDIS_PASSWORD"` RedisDB int `mapstructure:"REDIS_DB"` KafkaAddr string `mapstructure:"KAFKA_ADDR"` PrometheusAddr string `mapstructure:"PROMETHEUS_ADDR"` }
Click to show internal directories.
Click to hide internal directories.