Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Configs = configset.Set[Config]{ Default: &Config{ Addr: "0.0.0.0:" + sdkclient.DefaultPort, ServiceUrl: sdkclient.DefaultLocalURL, H2C: httpH2CConfig{Enable: true}, EnableGRPCReflection: true, CORS: CORSConfig{ AllowedOrigins: []string{"*"}, AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "HEAD"}, AllowedHeaders: []string{"*"}, AllowCredentials: true, }, Logger: LoggerConfig{ NonimportantLevel: zap.NewAtomicLevelAt(zap.DebugLevel), ImportantLevel: zap.NewAtomicLevelAt(zap.InfoLevel), ErrorsLevel: zap.NewAtomicLevelAt(zap.WarnLevel), NonimportantRegexes: []string{ `.*/List.*`, `.*/Get.*`, `/healthz`, `/readyz`, `/`, }, }, }, }
Functions ¶
Types ¶
type CORSConfig ¶
type Config ¶
type Config struct { // local server address, set to run server on different port Addr string `koanf:"addr"` // ak service url, used in client to connect to connect to specific ak server ServiceUrl string `koanf:"service_url"` H2C httpH2CConfig `koanf:"h2c"` // If not empty, write HTTP port to this file. // This is useful when starting with port 0, which means to get // the next port. This is done in testing to start on an unused // port to avoid conflict with an already running service. AddrFilename string `koanf:"addr_filename"` EnableGRPCReflection bool `koanf:"reflection"` Ngrok ngrokConfig `koanf:"ngrok"` Logger LoggerConfig `koanf:"logger"` CORS CORSConfig `koanf:"cors"` }
type LoggerConfig ¶
type LoggerConfig struct { ImportantLevel zap.AtomicLevel `koanf:"important_log_level"` NonimportantLevel zap.AtomicLevel `koanf:"nonimportant_log_level"` ErrorsLevel zap.AtomicLevel `koanf:"trace_errors_log_level"` // Requests that their paths matches any one of these regexes will be // logged in the nonimportant log level. NonimportantRegexes []string `koanf:"nonimportant_regexes"` }
Click to show internal directories.
Click to hide internal directories.