Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RecommendedHomeDir 定义了所有 skeleton 服务配置文件的默认存放目录. RecommendedHomeDir = ".skt" // RecommendedEnvPrefix 定义了所有 skeleton 服务环境变量的前缀. RecommendedEnvPrefix = "SKT" )
Variables ¶
This section is empty.
Functions ¶
func SetupSignalHandler ¶
func SetupSignalHandler() <-chan struct{}
SetupSignalHandler 返回一个 stop 通道,应用程序在监听到该通道关闭后,执行资源清理.
Types ¶
type CertKey ¶
type CertKey struct { // CertFile 是一个包含 PEM 编码的证书的文件,可能还包含完整的证书链. CertFile string // KeyFile 是一个包含 CertFile 指定证书 PEM 编码私钥的文件. KeyFile string }
CertKey 包含与证书相关的配置项.
type CompletedConfig ¶
type CompletedConfig struct {
*Config
}
CompletedConfig 是一个完整的 GenericAPIServer 配置.
func (*CompletedConfig) New ¶
func (c *CompletedConfig) New() (*GenericAPIServer, error)
type Config ¶
type Config struct { SecureServing *SecureServingInfo InsecureServing *InsecureServingInfo Jwt *JwtInfo Mode string Middlewares []string Healthz bool EnableProfiling bool EnableMetrics bool }
Config 是一个通用 API 服务器的配置结构.
type GenericAPIServer ¶
type GenericAPIServer struct { // SecureServingInfo 保存 HTTPS 服务配置 SecureServingInfo *SecureServingInfo // InsecureServingInfo 保存 HTTP 服务配置 InsecureServingInfo *InsecureServingInfo // ShutdownTimeout 表示优雅关闭的超时时间 ShutdownTimeout time.Duration *gin.Engine // contains filtered or unexported fields }
GenericAPIServer 包含一个 skeleton api 服务器的配置. type GenericAPIServer gin.Engine.
func (*GenericAPIServer) Run ¶
func (s *GenericAPIServer) Run() error
type InsecureServingInfo ¶
type InsecureServingInfo struct {
Address string
}
InsecureServingInfo 保存 HTTP 服务配置.
type SecureServingInfo ¶
SecureServingInfo 保存 HTTPS 服务配置.
func (*SecureServingInfo) Address ¶
func (s *SecureServingInfo) Address() string
Address 将 IP 和 port 拼接为一个地址字符串,如:0.0.0.0:8443.
Click to show internal directories.
Click to hide internal directories.