Documentation ¶
Index ¶
- func DestroyInfrastructure(i *Infrastructure)
- type CacheConfig
- type Config
- type DatabaseConfig
- type Infrastructure
- func (i Infrastructure) DBExecutor() database.Executor
- func (i Infrastructure) LocalCache() cache.Cache
- func (i Infrastructure) MqttMessageQueue() messageQueueCommon.MessageQueue
- func (i Infrastructure) RedisCache() cache.Cache
- func (i Infrastructure) RedisMessageQueue() messageQueueCommon.MessageQueue
- type MessageQueueConfig
- type MqttConfig
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DestroyInfrastructure ¶
func DestroyInfrastructure(i *Infrastructure)
Types ¶
type CacheConfig ¶ added in v0.7.0
type CacheConfig struct { Namespace string `json:"namespace" yaml:"namespace"` Redis *RedisConfig `json:"redis" yaml:"redis"` }
type Config ¶
type Config struct { DatabaseConfig CacheConfig MessageQueueConfig }
type DatabaseConfig ¶
type DatabaseConfig struct { Operations *operations.Config `json:"operations" yaml:"operations"` DataService *data_service.Config `json:"data_service" yaml:"data_service"` }
type Infrastructure ¶
type Infrastructure struct {
// contains filtered or unexported fields
}
Infrastructure 基础设施结构
func NewInfrastructure ¶
func NewInfrastructure(config Config) *Infrastructure
func (Infrastructure) DBExecutor ¶
func (i Infrastructure) DBExecutor() database.Executor
DBExecutor 获取数据库基础设施 参数: 无 返回值: - 数据库基础设施的接口
func (Infrastructure) LocalCache ¶ added in v0.7.0
func (i Infrastructure) LocalCache() cache.Cache
LocalCache 获取本地缓存基础设施 参数: 无 返回值: - 缓存基础设施的接口
func (Infrastructure) MqttMessageQueue ¶ added in v1.1.10
func (i Infrastructure) MqttMessageQueue() messageQueueCommon.MessageQueue
MqttMessageQueue 获取Mqtt消息队列基础设施 参数: 无 返回值: - 消息队列基础设施的接口
func (Infrastructure) RedisCache ¶ added in v0.7.0
func (i Infrastructure) RedisCache() cache.Cache
RedisCache 获取Redis缓存基础设施 参数: 无 返回值: - 缓存基础设施的接口
func (Infrastructure) RedisMessageQueue ¶ added in v1.1.8
func (i Infrastructure) RedisMessageQueue() messageQueueCommon.MessageQueue
RedisMessageQueue 获取Redis消息队列基础设施 参数: 无 返回值: - 消息队列基础设施的接口
type MessageQueueConfig ¶ added in v1.1.8
type MessageQueueConfig struct { Redis *RedisConfig `json:"redis" yaml:"redis"` Mqtt *MqttConfig `json:"mqtt" yaml:"mqtt"` }
type MqttConfig ¶ added in v1.1.10
type RedisConfig ¶ added in v0.11.37
type RedisConfig struct { Address string `json:"address" yaml:"address"` UserName string `json:"user_name" yaml:"user_name"` Password string `json:"password" yaml:"password"` DB int `json:"db" yaml:"db"` MaxLen int64 `json:"max_len" yaml:"max_len"` ConsumerNum int `json:"consumer_num" yaml:"consumer_num"` }
Click to show internal directories.
Click to hide internal directories.