package config import ( "reflect" ) // JSCKServer is the server section's configuration key. const JSCKServer string = "server" // JSCServer configures the outward server. Host is the address to listen // on (empty means every interface) and Port the port (0 means any free // port). type JSCServer struct { Host string `cfg:"host" default:"127.0.0.1"` Port int `cfg:"port" default:"9393"` Timeouts JSCServerTimeouts `cfg:"timeouts"` RateLimits JSCServerRateLimits `cfg:"rate_limits"` WebSocket JSCServerWebSocket `cfg:"websocket"` } // ---------- Section methods (see Section) ---------- // Map implements Section. func (c JSCServer) Map() map[string]any { return mapOf(c) } // Flatten implements Section. func (c JSCServer) Flatten() map[string]any { return flattenOf(JSCKServer, c) } // TypeOf implements Section. func (c JSCServer) TypeOf(key string) (reflect.Kind, error) { return typeOf(c, key) } // ValueOf implements Section. func (c JSCServer) ValueOf(key string) (any, error) { return valueOf(c, key) } // SetValue implements Section. func (c *JSCServer) SetValue(key string, value any) error { return setValue(c, key, value) }