package config import ( "reflect" ) // JSCKServerTLS is the TLS section's configuration key. const JSCKServerTLS string = "tls" // JSCServerTLS configures the server's TLS connections. CertFile and KeyFile // must be set when TLS is enabled. MinVersion is "1.2" or "1.3"; anything // else, including empty, means 1.2. RedirectHTTPPort, if set (e.g. 80), // starts a plain HTTP listener on that port that redirects everything to // HTTPS; 0 means none. type JSCServerTLS struct { Enabled bool `cfg:"enabled" default:"false"` CertFile string `cfg:"cert_file"` KeyFile string `cfg:"key_file"` MinVersion string `cfg:"min_version" default:"1.3"` RedirectHTTPPort int `cfg:"redirect_http_port"` } // ---------- Section methods (see Section) ---------- // Map implements Section. func (c JSCServerTLS) Map() map[string]any { return mapOf(c) } // Flatten implements Section. func (c JSCServerTLS) Flatten() map[string]any { return flattenOf(JSCKServerTLS, c) } // TypeOf implements Section. func (c JSCServerTLS) TypeOf(key string) (reflect.Kind, error) { return typeOf(c, key) } // ValueOf implements Section. func (c JSCServerTLS) ValueOf(key string) (any, error) { return valueOf(c, key) } // SetValue implements Section. func (c *JSCServerTLS) SetValue(key string, value any) error { return setValue(c, key, value) }