config

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewConfig)

Functions

This section is empty.

Types

type AppConfig added in v0.0.22

type AppConfig struct {
	Name string `json:"name"`

	Http    Http    `json:"http"`
	Rpc     Rpc     `json:"rpc"`
	Web     Web     `json:"web"`
	Gateway Gateway `json:"gateway"`
	Storage Storage `json:"storage"`

	Mysql    Mysql    `json:"mysql"`
	Redis    Redis    `json:"redis"`
	Influx   Influx   `json:"influx"`
	Rabbitmq Rabbitmq `json:"rabbitmq"`
	Jaeger   Jaeger   `json:"jaeger"`
	Nats     Nats     `json:"nats"`

	Slack    Slack    `json:"slack"`
	Rollbar  Rollbar  `json:"rollbar"`
	Telegram Telegram `json:"telegram"`
	// contains filtered or unexported fields
}

func CreateAppConfig added in v0.0.24

func CreateAppConfig(id string) (*AppConfig, error)

func NewConfig added in v0.0.22

func NewConfig(id string, consul *api.Client) *AppConfig

func (*AppConfig) GetConfig added in v0.0.24

func (c *AppConfig) GetConfig(key string) (string, error)

func (*AppConfig) GetSetting added in v0.0.24

func (c *AppConfig) GetSetting(key string) (string, error)

func (*AppConfig) GetSettings added in v0.0.24

func (c *AppConfig) GetSettings() (map[string]string, error)

func (*AppConfig) SetSetting added in v0.0.24

func (c *AppConfig) SetSetting(key, value string) error

func (*AppConfig) Watch added in v0.0.24

func (c *AppConfig) Watch()

type Gateway added in v0.0.24

type Gateway struct {
	Url string `json:"url" yaml:"url"`
}

Gateway config

type Http added in v0.0.22

type Http struct {
	Host string `json:"host" yaml:"host"`
	Port int    `json:"port" yaml:"port"`
	Mode string `json:"mode" yaml:"mode"`
}

Http http config

type Influx added in v0.0.22

type Influx struct {
	Token  string `json:"token" yaml:"token"`
	Org    string `json:"org" yaml:"org"`
	Bucket string `json:"bucket" yaml:"bucket"`
	Url    string `json:"url" yaml:"url"`
}

Influx config

type Jaeger added in v0.0.22

type Jaeger struct {
	Reporter struct {
		LocalAgentHostPort string `json:"localAgentHostPort" yaml:"localAgentHostPort"`
	} `json:"reporter" yaml:"reporter"`
	Sampler struct {
		Type  string  `json:"type" yaml:"type"`
		Param float64 `json:"param" yaml:"param"`
	} `json:"sampler" yaml:"sampler"`
}

Jaeger config

type Mysql added in v0.0.22

type Mysql struct {
	Url string `json:"url" yaml:"url"`
}

Mysql config

type Nats added in v0.0.24

type Nats struct {
	Url string `json:"url" yaml:"url"`
}

Nats config

type Rabbitmq added in v0.0.22

type Rabbitmq struct {
	Url string `json:"url" yaml:"url"`
}

Rabbitmq config

type Redis added in v0.0.22

type Redis struct {
	Addr     string `json:"addr" yaml:"addr"`
	Password string `json:"password" yaml:"password"`
}

Redis config

type Rollbar added in v0.0.22

type Rollbar struct {
	Token       string `json:"token" yaml:"token"`
	Environment string `json:"environment" yaml:"environment"`
}

Rollbar config

type Rpc added in v0.0.22

type Rpc struct {
	Host string `json:"host" yaml:"host"`
	Port int    `json:"port" yaml:"port"`
}

Rpc http config

type Slack added in v0.0.22

type Slack struct {
	Verification string `json:"verification" yaml:"verification"`
	Signing      string `json:"signing" yaml:"signing"`
	Token        string `json:"token" yaml:"token"`
	Webhook      string `json:"webhook" yaml:"webhook"`
}

Slack config

type Storage added in v0.0.22

type Storage struct {
	Path string `json:"path" yaml:"path"`
}

Storage config

type Telegram added in v0.0.22

type Telegram struct {
	Token string `json:"token" yaml:"token"`
}

Telegram config

type Web added in v0.0.22

type Web struct {
	Url string `json:"url" yaml:"url"`
}

Web config

Jump to

Keyboard shortcuts

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