Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContextWithGlobalOptions ¶
func NewContextWithGlobalOptions(parent context.Context, opts GlobalOptions) context.Context
NewContextWithGlobalOptions 将全局选项注入上下文
Types ¶
type GlobalOptions ¶
type GlobalOptions struct {
// Kubernetes 客户端配置选项
ClientConfig *genericclioptions.ConfigFlags
// 日志数量级别( 0 / 1 / 2 )
Verbosity uint32
// 数据存储根目录
DataRoot string
}
GlobalOptions 全局选项
func GlobalOptionsFromContext ¶
func GlobalOptionsFromContext(ctx context.Context) GlobalOptions
GlobalOptionsFromContext 从上下文获取全局选项
func NewDefaultGlobalOptions ¶
func NewDefaultGlobalOptions() GlobalOptions
NewDefaultGlobalOptions 返回默认全局选项
type InternalProxyOptions ¶
type InternalProxyOptions struct {
// 最大空闲时间(超过后代理服务自行关闭)
MaxIdleTime time.Duration
}
InternalProxyOptions internal-proxy 子命令选项
func NewDefaultInternalProxyOptions ¶
func NewDefaultInternalProxyOptions() InternalProxyOptions
NewDefaultInternalProxyOptions 创建一个默认的 internal-proxy 子命令选项
type Options ¶
type Options struct {
// 全局选项
Global GlobalOptions
// proxy 子命令选项
Proxy ProxyOptions
// proxies 子命令选项
Proxies ProxiesOptions
// shutdown 子命令选项
Shutdown ShutdownOptions
// version 子命令选项
Version VersionOptions
// internal-proxy 子命令选项
InternalProxyOptions InternalProxyOptions
}
Options pcrctl 运行选项
type ProxiesOptions ¶
type ProxiesOptions struct {
// 输出格式
OutputFormat string
}
ProxiesOptions proxies 子命令选项
func NewDefaultProxiesOptions ¶
func NewDefaultProxiesOptions() ProxiesOptions
NewDefaultProxiesOptions 创建一个默认的 proxies 子命令选项
type ProxyOptions ¶
type ProxyOptions struct {
// 监听地址
Address string
// 监听端口
Port int
// 监听 UNIX Socket
UNIXSocket string
// 允许访问的 Host
AcceptHosts string
// 允许访问的 URI 路径
AcceptPaths string
// 禁止访问的方法
RejectMethods string
// 禁止访问的 URI 路径
RejectPaths string
// 禁用过滤器
DisableFilter bool
// Kubernetes API URI 前缀
APIPrefix string
// 添加服务路径
AppendServerPath bool
// 静态文件路径
WWW string
// 静态文件服务 URI 前缀
WWWPrefix string
// 连接保持时长
Keepalive time.Duration
}
ProxyOptions proxy 子命令选项
func NewDefaultProxyOptions ¶
func NewDefaultProxyOptions() ProxyOptions
NewDefaultProxyOptions 创建一个默认的 proxy 子命令选项
type ShutdownOptions ¶
type ShutdownOptions struct {
// 等待代理退出
Wait bool
// 强制退出
Force bool
// 退出所有代理
All bool
}
ShutdownOptions shutdown 子命令选项
func NewDefaultShutdownOptions ¶
func NewDefaultShutdownOptions() ShutdownOptions
NewDefaultShutdownOptions 创建一个默认的 shutdown 子命令选项
type VersionOptions ¶ added in v0.2.0
type VersionOptions struct {
// 输出格式
// yaml 或 json
OutputFormat string
}
VersionOptions version 子命令选项
func NewDefaultVersionOptions ¶ added in v0.2.0
func NewDefaultVersionOptions() VersionOptions
NewDefaultVersionOptions 创建一个默认的 version 子命令选项
Click to show internal directories.
Click to hide internal directories.