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{ UnimportantLevel: zap.NewAtomicLevelAt(zap.DebugLevel), ImportantLevel: zap.NewAtomicLevelAt(zap.InfoLevel), ErrorsLevel: zap.NewAtomicLevelAt(zap.WarnLevel), UnimportantRegexes: []string{ `^/autokitteh.+/(Get|List)$`, `^/oauth/|/oauth$|/save$`, }, UnloggedRegexes: []string{ `/(healthz|readyz)$`, `\.(css|html|ico|js|png|svg|txt|webmanifest)$`, }, }, }, }
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"` UnimportantLevel zap.AtomicLevel `koanf:"unimportant_log_level"` ErrorsLevel zap.AtomicLevel `koanf:"trace_errors_log_level"` // URL requests with paths that match any one of these regular // expressions will be logged in the nonimportant log level. UnimportantRegexes []string `koanf:"nonimportant_regexes"` // URL requests with paths that match any one of these // regular expressions will not be logged at all. UnloggedRegexes []string `koanf:"unlogged_regexes"` }
Click to show internal directories.
Click to hide internal directories.