beego: Index | Files

package etcd

import ""


Package Files


type EtcdConfiger Uses

type EtcdConfiger struct {
    // contains filtered or unexported fields

func (*EtcdConfiger) DIY Uses

func (e *EtcdConfiger) DIY(key string) (interface{}, error)

DIY return the original response from etcd be careful when you decide to use this

func (*EtcdConfiger) GetSection Uses

func (e *EtcdConfiger) GetSection(section string) (map[string]string, error)

GetSection in this implementation, we use section as prefix

func (*EtcdConfiger) OnChange Uses

func (e *EtcdConfiger) OnChange(key string, fn func(value string))

TODO remove this before release v2.0.0

func (*EtcdConfiger) SaveConfigFile Uses

func (e *EtcdConfiger) SaveConfigFile(filename string) error

func (*EtcdConfiger) Set Uses

func (e *EtcdConfiger) Set(key, val string) error

Set do nothing and return an error I think write data to remote config center is not a good practice

func (*EtcdConfiger) Sub Uses

func (e *EtcdConfiger) Sub(key string) (config.Configer, error)

Sub return an sub configer.

func (*EtcdConfiger) Unmarshaler Uses

func (e *EtcdConfiger) Unmarshaler(prefix string, obj interface{}, opt ...config.DecodeOption) error

Unmarshaler is not very powerful because we lost the type information when we get configuration from etcd for example, when we got "5", we are not sure whether it's int 5, or it's string "5" TODO(support more complicated decoder)

type EtcdConfigerProvider Uses

type EtcdConfigerProvider struct {

func (*EtcdConfigerProvider) Parse Uses

func (provider *EtcdConfigerProvider) Parse(key string) (config.Configer, error)

Parse = ParseData([]byte(key)) key must be json

func (*EtcdConfigerProvider) ParseData Uses

func (provider *EtcdConfigerProvider) ParseData(data []byte) (config.Configer, error)

ParseData try to parse key as clientv3.Config, using this to build etcdClient

Package etcd imports 11 packages (graph). Updated 2020-11-07. Refresh now. Tools for package owners.