config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

*------------------------------------------------------------**

  • @filename config/config.go
  • @author jinycoo - caojingyin@jinycoo.com
  • @version 1.0.0
  • @date 2019/11/5 11:41
  • @desc config - summary **------------------------------------------------------------*

*------------------------------------------------------------**

  • @filename config/
  • @author jinycoo
  • @version 1.0.0
  • @date 2019-08-15 13:20
  • @desc config - **------------------------------------------------------------*

Index

Constants

View Source
const DefConfigFile = "app.toml"

Variables

This section is empty.

Functions

func TomlCfgInit

func TomlCfgInit(cfgPath string, v interface{}) (err error)

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 StringVars

type StringVars []string

StringVars []string implement flag.Value

func (*StringVars) Set

func (s *StringVars) Set(val string) error

Set implement flag.Value

func (StringVars) String

func (s StringVars) String() string

type Value

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

Value value.

Directories

Path Synopsis
*------------------------------------------------------------** * @filename dsn/ * @author jinycoo * @version 1.0.0 * @date 2019-07-25 13:38 * @desc dsn - **------------------------------------------------------------* *------------------------------------------------------------** * @filename dsn/ * @author jinycoo * @version 1.0.0 * @date 2019-07-29 19:02 * @desc dsn - **------------------------------------------------------------*
*------------------------------------------------------------** * @filename dsn/ * @author jinycoo * @version 1.0.0 * @date 2019-07-25 13:38 * @desc dsn - **------------------------------------------------------------* *------------------------------------------------------------** * @filename dsn/ * @author jinycoo * @version 1.0.0 * @date 2019-07-29 19:02 * @desc dsn - **------------------------------------------------------------*
*------------------------------------------------------------** * @filename env/env.go * @author jinycoo * @version 1.0.0 * @date 2019-07-15 13:14 * @desc env - environment params **------------------------------------------------------------*
*------------------------------------------------------------** * @filename env/env.go * @author jinycoo * @version 1.0.0 * @date 2019-07-15 13:14 * @desc env - environment params **------------------------------------------------------------*

Jump to

Keyboard shortcuts

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