config

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedisModuleName          = "Redis"            // 配置模块名
	RedisInfraConfigFileName = "infra.redis.yaml" // Redis基础设施配置文件名称
)

常量相关定义

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisInfraConfig

type RedisInfraConfig struct {
	UseExternalHost  bool                  `mapstructure:"useExternalHost" default:"false"`            // 是否使用外网连接                                                             // 使用外网地址(默认为false)
	HostPort         string                `mapstructure:"hostPort" default:"127.0.0.1:6379" `         // Redis外网主机名称或访问地址和访问端口
	InternalHostPort string                `mapstructure:"internalHostPort" default:"127.0.0.1:6379" ` // Redis内网主机名称或访问地址和访问端口
	Password         string                `mapstructure:"password" default:"" `                       // 登录密码,默认为空
	DB               int                   `mapstructure:"db" default:"0" `                            // 数据库索引(从0开始),根据数据库个数逐个递增
	base.BaseConfig  `mapstructure:"omit"` // 基础配置信息
}

RedisInfraConfig Redis基础设施配置结构定义

func New

func New(source common.ConfigSource, useExternalHost bool) (*RedisInfraConfig, error)

New 创建Redis基础设施配置

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL