Documentation ¶
Index ¶
- type ApiConfig
- type App
- func (app *App) AddMqttApi(mqttApi *mqtt_api.MqttApi)
- func (app *App) Api() *api.Api
- func (app *App) ChooseRouter(routerType string, version string) api.Router
- func (app *App) Finish() error
- func (app *App) FinishMqttApi() error
- func (app *App) Infrastructure() *infrastructure.Infrastructure
- func (app *App) MqttApi() *mqtt_api.MqttApi
- func (app *App) Start() error
- func (app *App) StartMqttApi() error
- type Config
- type InfoIDField
- type InfoTenantIDField
- type InfoTimeFields
- type InfoUserIDFields
- type InfrastructureConfig
- type MqttApiConfig
- type MqttConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) AddMqttApi ¶ added in v1.5.0
func (*App) ChooseRouter ¶
ChooseRouter 选择Router 参数: - routerType: 路由类型,有两种
- api.RouterRoot: 根路由
- api.RouterPrefix: 带url前缀的路由
- version: 版本,用于获取基于上面两中路由够造的带有版本号的路由,传空字符串则选定上面两种路由本身 返回值: - 选择的Router
func (*App) FinishMqttApi ¶ added in v1.5.0
func (*App) Infrastructure ¶
func (app *App) Infrastructure() *infrastructure.Infrastructure
Infrastructure 获取Infrastructure实例 参数: 无 返回值: - Infrastructure实例
func (*App) StartMqttApi ¶ added in v1.5.0
type Config ¶
type Config struct { ApiConfig `json:"api" yaml:"api"` InfrastructureConfig `json:"infrastructure" yaml:"infrastructure"` *MqttApiConfig `json:"mqtt_api" yaml:"mqtt_api"` }
func LoadFromJson ¶
func LoadFromJsonFile ¶
func LoadFromYaml ¶
func LoadFromYamlFile ¶
type InfoIDField ¶
type InfoIDField struct {
ID string `json:"id" sqlresult:"column:id"`
}
InfoIDField Info的ID字段
type InfoTenantIDField ¶
type InfoTenantIDField struct {
TenantID string `json:"tenantId" sqlresult:"column:tenant_id"`
}
InfoTenantIDField Info的租户ID字段
type InfoTimeFields ¶
type InfoTimeFields struct { CreatedTime string `json:"createdTime" sqlresult:"column:created_time;timeLayout:'2006-01-02 15:04:05'"` LastUpdatedTime string `json:"lastUpdatedTime" sqlresult:"column:last_updated_time;timeLayout:'2006-01-02 15:04:05'"` }
InfoTimeFields Info的时间相关字段
type InfoUserIDFields ¶
type InfoUserIDFields struct { CreateUserID string `json:"createUserId" sqlresult:"column:create_user_id;"` LastUpdateUserID string `json:"lastUpdateUserId" sqlresult:"column:last_update_user_id;"` }
InfoUserIDFields Info的用户ID相关字段
type InfrastructureConfig ¶
type InfrastructureConfig struct { Database infrastructure.DatabaseConfig `json:"database" yaml:"database"` Cache infrastructure.CacheConfig `json:"cache" yaml:"cache"` MessageQueue infrastructure.MessageQueueConfig `json:"message_queue" yaml:"message_queue"` }
type MqttApiConfig ¶ added in v1.5.0
type MqttApiConfig struct { TopicPrefix string `json:"topic_prefix" yaml:"topic_prefix"` LogSkipPaths []string `json:"log_skip_paths" yaml:"log_skip_paths"` MqttConfig MqttConfig `json:"mqtt_config" yaml:"mqtt_config"` }
type MqttConfig ¶ added in v1.5.0
type MqttConfig struct { UserName string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` Address string `json:"address" yaml:"address"` ClientID string `json:"client_id" yaml:"client_id"` KeepAliveSec int64 `json:"keep_alive_sec" yaml:"keep_alive_sec"` PingTimeoutSec int64 `json:"ping_timeout_sec" yaml:"ping_timeout_sec"` WriteTimeoutSec int64 `json:"write_timeout_sec" yaml:"write_timeout_sec"` }
Click to show internal directories.
Click to hide internal directories.