Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { ID string `json:"id" yaml:"id"` Name string `json:"name" yaml:"name"` Log logging.Options `json:"log" yaml:"log"` HTTP HTTP `json:"http" yaml:"http"` GRPC GRPC `json:"grpc" yaml:"grpc"` Auth0 struct { Domain string `json:"domain" yaml:"domain"` ClientID string `json:"client_id" yaml:"clientID"` ClientSecret string `json:"client_secret" yaml:"clientSecret"` CallbackURL string `json:"callback_url" yaml:"callbackURL"` Audiences []string `json:"audiences" yaml:"audiences"` } `json:"auth0" yaml:"auth0"` Casbin struct { // Enabled is the casbin enabled Enabled bool `json:"enabled" yaml:"enabled"` // ModelPath is the casbin model path ModelPath string `json:"model_path" yaml:"modelPath"` // PolicyDriver is the casbin policy driver PolicyDriver string `json:"policy_driver" yaml:"policyDriver"` } `json:"casbin" yaml:"casbin"` Storage struct { Mysql struct { DSN string `json:"dsn" yaml:"dsn"` } `json:"mysql" yaml:"mysql"` Postgresql struct { DSN string `json:"dsn" yaml:"dsn"` } `json:"postgresql" yaml:"postgresql"` Mongodb struct { DSN string `json:"dsn" yaml:"dsn"` } `json:"mongodb" yaml:"mongodb"` Redis struct { Addr string `json:"addr" yaml:"addr"` } `json:"redis" yaml:"redis"` } `json:"storage" yaml:"storage"` Kafka struct { Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` Brokers []string `json:"brokers" yaml:"brokers"` } `json:"kafka" yaml:"kafka"` OTel struct { Target string `json:"target" yaml:"target"` } `json:"otel" yaml:"otel"` }
Application defines the application struct.
func NewApplication ¶
func NewApplication(v *viper.Viper, name string) (*Application, error)
NewApplication is used to create a new application.
func (*Application) GetID ¶
func (x *Application) GetID() string
GetID is used to get the application id.
func (*Application) String ¶
func (x *Application) String() string
type Configuration ¶
type Configuration struct { RestaurantRestful Application `json:"restaurant_restful" yaml:"restaurantRestful"` OrderRestful Application `json:"order_restful" yaml:"orderRestful"` OrderHandler Application `json:"order_handler" yaml:"orderHandler"` UserRestful Application `json:"user_restful" yaml:"userRestful"` LogisticsRestful Application `json:"logistics_restful" yaml:"logisticsRestful"` NotifyRestful Application `json:"notify_restful" yaml:"notifyRestful"` Log logging.Options `json:"log" yaml:"log"` Services map[string]*Application `json:"services" yaml:"services"` }
Configuration defines the configuration struct.
func NewConfiguration ¶
func NewConfiguration(v *viper.Viper) (*Configuration, error)
NewConfiguration creates a new configuration.
func (*Configuration) GetService ¶
func (x *Configuration) GetService(name string) (*Application, error)
GetService is used to get the service by name.
type GRPC ¶
type GRPC struct { URL string `json:"url" yaml:"url"` Host string `json:"host" yaml:"host"` Port int `json:"port" yaml:"port"` }
GRPC defines the grpc struct.
Click to show internal directories.
Click to hide internal directories.