Documentation ¶
Index ¶
- Constants
- Variables
- func OnConfigChange()
- type GRcpConfig
- func (g *GRcpConfig) AllSettings() map[string]interface{}
- func (g *GRcpConfig) DelConfig() error
- func (g *GRcpConfig) DelConfigParam(env string, namespace string, project string, version string) error
- func (g *GRcpConfig) Get(key string) interface{}
- func (g *GRcpConfig) GetAll() (string, error)
- func (g *GRcpConfig) GetAllParam(env string, namespace string, project string, version string) (string, error)
- func (g *GRcpConfig) GetBool(key string) bool
- func (g *GRcpConfig) GetDuration(key string) time.Duration
- func (g *GRcpConfig) GetFloat64(key string) float64
- func (g *GRcpConfig) GetInt(key string) int
- func (g *GRcpConfig) GetInt32(key string) int32
- func (g *GRcpConfig) GetInt64(key string) int64
- func (g *GRcpConfig) GetIntSlice(key string) []int
- func (g *GRcpConfig) GetSizeInBytes(key string) uint
- func (g *GRcpConfig) GetString(key string) string
- func (g *GRcpConfig) GetStringMap(key string) map[string]interface{}
- func (g *GRcpConfig) GetStringMapString(key string) map[string]string
- func (g *GRcpConfig) GetStringMapStringSlice(key string) map[string][]string
- func (g *GRcpConfig) GetStringSlice(key string) []string
- func (g *GRcpConfig) GetTime(key string) time.Time
- func (g *GRcpConfig) GetUint(key string) uint
- func (g *GRcpConfig) GetUint32(key string) uint32
- func (g *GRcpConfig) GetUint64(key string) uint64
- func (g *GRcpConfig) PutConfig(data string) error
- func (g *GRcpConfig) PutConfigParam(env string, namespace string, project string, version string, data string) error
Constants ¶
const ( FN = "application" //生成配置文件的名称 Ext = "json" //生成配置文件的后缀 ServerHost = "GO_GRPC_CONFIG_SERVER_HOST" //服务端地址 ENV = "GO_GRPC_CONFIG_ENV" //环境 NAMESPACE = "GO_GRPC_CONFIG_NAMESPACE" //命名空间 PROJECT = "GO_GRPC_CONFIG_PROJECT" //项目 VERSION = "GO_GRPC_CONFIG_VERSION" //版本 )
Variables ¶
var (
I *info
)
Functions ¶
func OnConfigChange ¶ added in v1.1.4
func OnConfigChange()
Types ¶
type GRcpConfig ¶
type GRcpConfig struct {
// contains filtered or unexported fields
}
var (
C *GRcpConfig
)
func (*GRcpConfig) AllSettings ¶
func (g *GRcpConfig) AllSettings() map[string]interface{}
func (*GRcpConfig) DelConfig ¶ added in v1.1.0
func (g *GRcpConfig) DelConfig() error
DelConfig @Author liangdongpo @Description 删除缓存**慎用,安排默认参数,会把此环境、命名空间、项目、版本条件的缓存都删除 @Date 12:35 下午 2021/11/18 @Param @return
func (*GRcpConfig) DelConfigParam ¶ added in v1.1.3
func (g *GRcpConfig) DelConfigParam(env string, namespace string, project string, version string) error
DelConfigParam @Author liangdongpo @Description 删除缓存,按传来的参数 @Date 2:24 下午 2021/11/18 @Param @return
func (*GRcpConfig) Get ¶
func (g *GRcpConfig) Get(key string) interface{}
Get @Author liangdongpo @Description 获取某个缓存,只支持默认参数下 @Date 2:25 下午 2021/11/18 @Param @return
func (*GRcpConfig) GetAll ¶ added in v1.1.1
func (g *GRcpConfig) GetAll() (string, error)
GetAll @Author liangdongpo @Description 获取所有配置,按默认的参数:string 类型 @Date 12:45 下午 2021/11/18 @Param @return
func (*GRcpConfig) GetAllParam ¶ added in v1.1.2
func (g *GRcpConfig) GetAllParam(env string, namespace string, project string, version string) (string, error)
GetAllParam @Author liangdongpo @Description 自定义参数获取全部配置 @Date 1:38 下午 2021/11/18 @Param @return
func (*GRcpConfig) GetDuration ¶
func (g *GRcpConfig) GetDuration(key string) time.Duration
func (*GRcpConfig) GetFloat64 ¶
func (g *GRcpConfig) GetFloat64(key string) float64
func (*GRcpConfig) GetInt32 ¶
func (g *GRcpConfig) GetInt32(key string) int32
func (*GRcpConfig) GetInt64 ¶
func (g *GRcpConfig) GetInt64(key string) int64
func (*GRcpConfig) GetIntSlice ¶
func (g *GRcpConfig) GetIntSlice(key string) []int
func (*GRcpConfig) GetSizeInBytes ¶
func (g *GRcpConfig) GetSizeInBytes(key string) uint
func (*GRcpConfig) GetString ¶
func (g *GRcpConfig) GetString(key string) string
GetString @Author liangdongpo @Description 获取string类型的缓存,只支持默认参数下 @Date 2:30 下午 2021/11/18 @Param @return
func (*GRcpConfig) GetStringMap ¶
func (g *GRcpConfig) GetStringMap(key string) map[string]interface{}
func (*GRcpConfig) GetStringMapString ¶
func (g *GRcpConfig) GetStringMapString(key string) map[string]string
func (*GRcpConfig) GetStringMapStringSlice ¶
func (g *GRcpConfig) GetStringMapStringSlice(key string) map[string][]string
func (*GRcpConfig) GetStringSlice ¶
func (g *GRcpConfig) GetStringSlice(key string) []string
func (*GRcpConfig) GetUint ¶
func (g *GRcpConfig) GetUint(key string) uint
func (*GRcpConfig) GetUint32 ¶
func (g *GRcpConfig) GetUint32(key string) uint32
func (*GRcpConfig) GetUint64 ¶
func (g *GRcpConfig) GetUint64(key string) uint64
func (*GRcpConfig) PutConfig ¶ added in v1.1.0
func (g *GRcpConfig) PutConfig(data string) error
PutConfig @Author liangdongpo @Description 设置缓存,按默认参数 @Date 12:33 下午 2021/11/18 @Param @return
func (*GRcpConfig) PutConfigParam ¶ added in v1.1.3
func (g *GRcpConfig) PutConfigParam(env string, namespace string, project string, version string, data string) error
PutConfigParam @Author liangdongpo @Description 设置缓存,按传来的参数 @Date 2:23 下午 2021/11/18 @Param @return
Directories ¶
Path | Synopsis |
---|---|
kitex_gen
|
|
grpcConfig/grpcconfig
Code generated by Kitex v0.1.0.
|
Code generated by Kitex v0.1.0. |