Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadAuthKey ¶
func LoadAuthKey() string
func LoadConfig ¶
func LoadConfig(configFileName string, config interface{})
LoadConfig loads configuration into `config` object Pulls configuration from env vars and config file Config should be a yaml file with `configFileName` and 'yaml' extension for example: `.registry` Available paths: $HOME, same as binary ENV vars have precedence configFileName - name of config file without extension. Config file should have yaml format and property Names should start with lowercase latter Evn var should be uppercased
Types ¶
type Auth ¶
type Auth struct { AuthServerUrl string `default:"http://localhost:4434"` AuthAppUrl string `default:"http://localhost:4455"` AuthAPIGW string `default:"http://localhost:8080"` BypassAuthMode bool `default:"false"` KetoUrl string `default:"http://localhost:4466"` }
func LoadAuthHostConfig ¶
type BaseConfig ¶
type BaseConfig struct {
DebugMode bool
}
Common properties for all configs. Don't forget to use `mapstructure:",squash"`. See unittest for example
type Database ¶
type Database struct { Host string `default:"localhost"` Password string `default:"Pass2020!"` DbName string Username string `default:"postgres"` SslEnabled bool `default:"false"` Port int `default:"5432"` }
func DefaultDatabaseName ¶
func (Database) GetConnString ¶
type Forward ¶
type Forward struct { Ip string `json:"ip"` Port int `json:"port"` Path string `json:"default_path"` }
Service would be listing on this IP and Port for incoming messages
func DefaultForwardConfig ¶
func DefaultForwardConfig() Forward
type GrpcService ¶
type Metrics ¶
func DefaultMetrics ¶
func DefaultMetrics() *Metrics
type MsgClient ¶
type MsgClient struct { Host string `default:"localhost:9095"` Timeout time.Duration `default:"3s"` RetryCount int8 `default:"3"` Exchange string `default:"amq.topic"` ListenQueue string `default:""` PublishQueue string `default:""` ListenerRoutes []string }
Message Client for a system which talks to MsgBus
type Pattern ¶
type Pattern struct {
Routes []Route
}
Service would a have some finite number of routes thorugh which it could be reached.
type Queue ¶
type Queue struct {
Uri string `default:"amqp://guest:guest@localhost:5672"` // Env var name: QUEUE_URI or in file Queue: { Uri: "" }. Example: QUEUE_URI=amqp://guest:guest@localhost:5672/
}
Messaging systems URI
func (*Queue) SafeString ¶
SafeString returns URI without password for logging purpose
type Service ¶
type Service struct { Host string `default:"localhost"` Port string `default:"9090"` Uri string `default:"localhost:9090"` }
func LoadServiceHostConfig ¶
type ServiceApiIf ¶
type ServiceApiIf struct { Name string `json:"name"` P []Route `json:"patterns"` F Forward `json:"forward"` }
Service API interface is registered to Router service. So that Router service know when and where to reach service.