Documentation
¶
Overview ¶
Package server 定义了所有平台通用的通用 apiserver
Index ¶
Constants ¶
View Source
const ( // RecommendedHomeDir 定义了所有服务配置的默认目录 RecommendedHomeDir = ".iam-apiserver" // RecommendedEnvPrefix 定义了所有服务的 ENV 前缀 RecommendedEnvPrefix = "IAM_APISERVER" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CertKey ¶
type CertKey struct {
// CertFile 包含 PEM 编码的证书,可能包含完整的证书链
CertFile string
// KeyFile 包含 PEM 编码的证书的私钥
KeyFile string
}
CertKey contains configuration items related to certificate. 包含与证书相关的配置项
type CompletedConfig ¶
type CompletedConfig struct {
*Config
}
CompletedConfig 是 GenericAPIServer 的完成配置
func (CompletedConfig) New ¶
func (c CompletedConfig) New() (*GenericAPIServer, error)
New 从给定的配置创建一个新的 GenericAPIServer 实例
type Config ¶
type Config struct {
SecureServing *SecureServingInfo
InsecureServing *InsecureServingInfo
Jwt *JwtInfo
Mode string
Middlewares []string
Healthz bool
EnableProfiling bool
EnableMetrics bool
}
Config 是用于配置 GenericAPIServer 的结构体 其成员按重要性排序
func (*Config) Complete ¶
func (c *Config) Complete() CompletedConfig
Complete 填充任何未设置的字段,这些字段是必需的,并且可以从其他字段派生出来 如果需要 `ApplyOptions`,请先执行该操作。它正在修改接收者。
type GenericAPIServer ¶
type GenericAPIServer struct {
SecureServingInfo *SecureServingInfo
InsecureServingInfo *InsecureServingInfo
ShutdownTimeout time.Duration
*gin.Engine
// contains filtered or unexported fields
}
GenericAPIServer 定义通用 API 服务器
func (*GenericAPIServer) InstallAPIs ¶
func (s *GenericAPIServer) InstallAPIs()
InstallAPIs 安装通用 API
func (*GenericAPIServer) InstallMiddlewares ¶
func (s *GenericAPIServer) InstallMiddlewares()
InstallMiddlewares 安装中间件
type InsecureServingInfo ¶
type InsecureServingInfo struct {
Address string
}
InsecureServingInfo 包含不安全 HTTP 服务器的配置信息
type JwtInfo ¶
type JwtInfo struct {
// Realm 默认值为 "iam jwt"
Realm string
// Key 默认值为空
Key string
// Timeout 默认值为一小时
Timeout time.Duration
// MaxRefresh 默认值为零
MaxRefresh time.Duration
}
JwtInfo 定义了用于创建 JWT 认证中间件的 JWT 字段
type SecureServingInfo ¶
type SecureServingInfo struct {
// BindAddress 绑定地址
BindAddress string
// BindPort 绑定端口
BindPort int
// CertKey 包含证书和私钥的配置
CertKey CertKey
}
包含 TLS 服务器的配置信息
func (*SecureServingInfo) Address ¶
func (s *SecureServingInfo) Address() string
Address 将主机 IP 地址和主机端口号连接成一个地址字符串,例如:0.0.0.0:8443
Click to show internal directories.
Click to hide internal directories.