conf

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is config client.

func New

func New() (cli *Client, err error)

New new a ugc config center client.

func (*Client) ConfIng

func (c *Client) ConfIng(name string) (v *Value, err error)

ConfIng confIng.

func (*Client) Configs

func (c *Client) Configs() (confs []*Value, ok bool)

Configs configs.

func (*Client) Create

func (c *Client) Create(name, content, operator, mark string) (err error)

Create create.

func (*Client) Event

func (c *Client) Event() <-chan string

Event client update event.

func (*Client) Path

func (c *Client) Path() string

Path get confFile Path.

func (*Client) SetCustomize

func (c *Client) SetCustomize(value string)

SetCustomize set customize value.

func (*Client) Toml

func (c *Client) Toml() (cf string, ok bool)

Toml return config value.

func (*Client) Toml2

func (c *Client) Toml2() (cf string, ok bool)

Toml2 return config value.

func (*Client) Update

func (c *Client) Update(ID int64, content, operator, mark string) (err error)

Update update.

func (*Client) Value

func (c *Client) Value(key string) (cf string, ok bool)

Value return config value.

func (*Client) Value2

func (c *Client) Value2(key string) (cf string, ok bool)

Value2 return config value.

func (*Client) Watch

func (c *Client) Watch(filename ...string)

Watch watch filename change.

func (*Client) WatchAll

func (c *Client) WatchAll()

WatchAll watch all filename change.

type Namespace

type Namespace struct {
	Name string            `json:"name"`
	Data map[string]string `json:"data"`
}

Namespace the key-value config object.

type Value

type Value struct {
	CID    int64  `json:"cid"`
	Name   string `json:"name"`
	Config string `json:"config"`
}

Value value.

Directories

Path Synopsis
Package dsn implements dsn parse with struct bind
Package dsn implements dsn parse with struct bind
Package env get env & app config, all the public field must after init() finished and flag.Parse().
Package env get env & app config, all the public field must after init() finished and flag.Parse().

Jump to

Keyboard shortcuts

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