config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: MIT Imports: 11 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 {
	ID   string
	Name string `json:"name" yaml:"name"`

	SvcAddr SvcAddr `json:"svc_addr" yaml:"svc_addr"`
	Http    Http    `json:"http" yaml:"http"`
	Rpc     Rpc     `json:"rpc" yaml:"rpc"`
	Web     Web     `json:"web" yaml:"web"`
	Gateway Gateway `json:"gateway" yaml:"gateway"`
	Storage Storage `json:"storage" yaml:"storage"`
	Jwt     Jwt     `json:"jwt" yaml:"jwt"`

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

	Rollbar  Rollbar  `json:"rollbar" yaml:"rollbar"`
	Newrelic Newrelic `json:"newrelic" yaml:"newrelic"`

	// Notification
	config.ConfYaml
	// 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, kv *etcd.Client) *AppConfig

func (*AppConfig) GetConfig added in v0.0.24

func (c *AppConfig) GetConfig(ctx context.Context, key string) (string, error)

func (*AppConfig) GetSetting added in v0.0.24

func (c *AppConfig) GetSetting(ctx context.Context, key string) (string, error)

func (*AppConfig) GetSettings added in v0.0.24

func (c *AppConfig) GetSettings(ctx context.Context) (map[string]string, error)

func (*AppConfig) SetSetting added in v0.0.24

func (c *AppConfig) SetSetting(ctx context.Context, key, value string) error

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 Jwt added in v0.2.1

type Jwt struct {
	Secret string `json:"secret" yaml:"secret"`
}

Jwt config

type Mysql added in v0.0.22

type Mysql struct {
	Dsn string `json:"dsn" yaml:"dsn"`
}

Mysql config

type Nats added in v0.0.24

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

Nats config

type Newrelic added in v0.0.25

type Newrelic struct {
	Name    string `json:"name" yaml:"name"`
	License string `json:"license" yaml:"license"`
}

Newrelic 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 Storage added in v0.0.22

type Storage struct {
	Adapter string `json:"adapter" yaml:"adapter"`
}

Storage config

type SvcAddr added in v0.0.26

type SvcAddr struct {
	Id       string `json:"id" yaml:"id"`
	Dtm      string `json:"dtm" yaml:"dtm"`
	Chatbot  string `json:"chatbot" yaml:"chatbot"`
	Message  string `json:"message" yaml:"message"`
	Middle   string `json:"middle" yaml:"middle"`
	Workflow string `json:"workflow" yaml:"workflow"`
	User     string `json:"user" yaml:"user"`
	Nlp      string `json:"nlp" yaml:"nlp"`
	Storage  string `json:"storage" yaml:"storage"`
	Task     string `json:"task" yaml:"task"`
	Bot      string `json:"bot" yaml:"bot"`
}

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