Documentation ¶
Index ¶
- func AddKubernetesTypesToScheme(scheme *runtime.Scheme)
- func ConvertToTable(ctx context.Context, tableConvertor registryrest.TableConvertor, ...) (*metav1.Table, error)
- func IndexFieldsForAppsV1ReplicaSet(ctx context.Context, c cache.Cache) error
- func IndexFieldsForCoreV1Event(ctx context.Context, c cache.Cache) error
- func IndexFieldsForCoreV1Pod(ctx context.Context, c cache.Cache) error
- func IndexFieldsForObject(ctx context.Context, c cache.Cache, obj client.Object) error
- func IndexFieldsForObjectMeta(ctx context.Context, c cache.Cache, obj client.Object) error
- func NewDefaultTableConvertor(config *rest.Config, scheme *runtime.Scheme) (registryrest.TableConvertor, error)
- func NewProxyHandler(ctx context.Context, apiProxyPrefix string, filter *proxy.FilterServer, ...) (http.Handler, error)
- func ParseGetOptions(req *http.Request) (metav1.GetOptions, error)
- func ParseListOptions(req *http.Request) (metav1.ListOptions, error)
- func ToPartial(obj runtime.Object) (runtime.Object, bool)
- func WriteResponse(w http.ResponseWriter, code int, obj interface{})
- type APIProxyServerOptions
- type AggregateTableConvertor
- type CacheProxyHandler
- func (h *CacheProxyHandler) Handle(req *http.Request) (runtime.Object, error)
- func (h *CacheProxyHandler) HandleGet(ctx context.Context, obj client.Object, namespace, name string, ...) error
- func (h *CacheProxyHandler) HandleList(ctx context.Context, obj client.ObjectList, namespace string, ...) error
- func (h *CacheProxyHandler) IsCached(req *http.Request) bool
- func (h *CacheProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
- type ListenFunc
- type ListenerOptions
- type MultiVersionTableConvertor
- type Server
- type ServerOptions
- type StaticServerOptions
- type TCPListenerOptions
- type TableConvertorGetter
- func BuiltinTableConvertorGetter(scheme *runtime.Scheme) TableConvertorGetter
- func NewCRDTableConvertorGetter(crdGetter listersapiextensionsv1.CustomResourceDefinitionLister) TableConvertorGetter
- func NewCRDTableConvertorGetterForConfig(config *rest.Config) (TableConvertorGetter, error)
- func NewCachedTableConvertorGetter(getter TableConvertorGetter) TableConvertorGetter
- type TableConvertorGetterFunc
- type TableConvertorGetters
- type UNIXSocketListenerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKubernetesTypesToScheme ¶
AddKubernetesTypesToScheme 添加 Kubernetes 资源到 scheme
func ConvertToTable ¶
func ConvertToTable( ctx context.Context, tableConvertor registryrest.TableConvertor, obj runtime.Object, ) (*metav1.Table, error)
ConvertToTable 将 obj 转换为表格形式
func IndexFieldsForAppsV1ReplicaSet ¶ added in v0.1.1
IndexFieldsForAppsV1ReplicaSet 为 appsv1.ReplicaSet 设置字段索引
func IndexFieldsForCoreV1Event ¶ added in v0.1.1
IndexFieldsForCoreV1Event 为 corev1.Event 设置字段索引
func IndexFieldsForCoreV1Pod ¶
IndexFieldsForCoreV1Pod 为 corev1.Pod 设置字段索引
func IndexFieldsForObject ¶ added in v0.1.1
IndexFieldsForObject 为对象设置字段索引
func IndexFieldsForObjectMeta ¶ added in v0.1.1
IndexFieldsForObjectMeta 为任意资源添加 metadata 字段索引
func NewDefaultTableConvertor ¶ added in v0.1.2
func NewDefaultTableConvertor(config *rest.Config, scheme *runtime.Scheme) (registryrest.TableConvertor, error)
NewDefaultTableConvertor 创建一个默认的 TableConvertor
func NewProxyHandler ¶
func NewProxyHandler( ctx context.Context, apiProxyPrefix string, filter *proxy.FilterServer, cfg *rest.Config, mapper meta.RESTMapper, keepalive time.Duration, appendLocationPath bool, notify func(*http.Request), ) (http.Handler, error)
NewProxyHandler 创建一个代理 HTTP 处理器
func ParseGetOptions ¶
func ParseGetOptions(req *http.Request) (metav1.GetOptions, error)
ParseGetOptions 解析请求 Get 选项
func ParseListOptions ¶
func ParseListOptions(req *http.Request) (metav1.ListOptions, error)
ParseListOptions 解析请求 List 选项
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, code int, obj interface{})
WriteResponse 写响应
Types ¶
type APIProxyServerOptions ¶
type APIProxyServerOptions struct { URIPrefix string Filter *proxy.FilterServer Keepalive time.Duration AppendLocationPath bool }
APIProxyServerOptions API 代理服务选项
type AggregateTableConvertor ¶ added in v0.1.2
type AggregateTableConvertor struct {
TableConvertorGetter TableConvertorGetter
}
AggregateTableConvertor 聚合的 TableConvertor
type CacheProxyHandler ¶
type CacheProxyHandler struct {
// contains filtered or unexported fields
}
CacheProxyHandler 缓存代理 HTTP 处理器
func NewCacheProxyHandler ¶
func NewCacheProxyHandler( ctx context.Context, config *rest.Config, mapper meta.RESTMapper, apiProxyPrefix string, ) (*CacheProxyHandler, error)
NewCacheProxyHandler 创建一个缓存代理 HTTP 处理器
func (*CacheProxyHandler) HandleGet ¶
func (h *CacheProxyHandler) HandleGet( ctx context.Context, obj client.Object, namespace, name string, opts metav1.GetOptions, ) error
HandleGet 处理获取对象
func (*CacheProxyHandler) HandleList ¶
func (h *CacheProxyHandler) HandleList( ctx context.Context, obj client.ObjectList, namespace string, opts metav1.ListOptions, ) error
HandleList 处理列出对象
func (*CacheProxyHandler) IsCached ¶
func (h *CacheProxyHandler) IsCached(req *http.Request) bool
IsCached 判断该请求是否有缓存
func (*CacheProxyHandler) ServeHTTP ¶
func (h *CacheProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP 处理 HTTP 请求
type ListenerOptions ¶
type ListenerOptions struct { TCP *TCPListenerOptions UNIXSocket *UNIXSocketListenerOptions }
ListenerOptions 监听器选项
type MultiVersionTableConvertor ¶ added in v0.1.2
type MultiVersionTableConvertor struct { IntervalVersion registryrest.TableConvertor Scheme *runtime.Scheme }
MultiVersionTableConvertor 基于 __internal 版本资源的 TableConvertor 的可转换多版本资源的 TableConvertor
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server 代理服务
type ServerOptions ¶
type ServerOptions struct { // Kubernetes 客户端配置 ClientConfig *rest.Config // Kubernetes API 映射器 RESTMapper meta.RESTMapper // 监听选项 Listener ListenerOptions // Kubernetes API 代理 APIProxy APIProxyServerOptions // 静态文件服务 Static StaticServerOptions // 最大空闲时间(超过后代理服务自行关闭) MaxIdleTime time.Duration }
ServerOptions 代理服务选项
type StaticServerOptions ¶
StaticServerOptions 静态服务选项
type TCPListenerOptions ¶
TCPListenerOptions 监听 TCP 选项
type TableConvertorGetter ¶ added in v0.1.2
type TableConvertorGetter interface { // TableConvertorForObject 获取指定对象的表格转换器 TableConvertorForObject(obj runtime.Object) (registryrest.TableConvertor, error) }
TableConvertorGetter TableConvertor 获取器
func BuiltinTableConvertorGetter ¶ added in v0.1.2
func BuiltinTableConvertorGetter(scheme *runtime.Scheme) TableConvertorGetter
BuiltinTableConvertorGetter 内置对象 TableConvertor 的 TableConvertorGetter
func NewCRDTableConvertorGetter ¶ added in v0.1.2
func NewCRDTableConvertorGetter( crdGetter listersapiextensionsv1.CustomResourceDefinitionLister, ) TableConvertorGetter
NewCRDTableConvertorGetter 创建一个 CRD TableConvertorGetter
func NewCRDTableConvertorGetterForConfig ¶ added in v0.1.2
func NewCRDTableConvertorGetterForConfig(config *rest.Config) (TableConvertorGetter, error)
NewCRDTableConvertorGetterForConfig 基于客户端配置创建一个 CRD TableConvertorGetter
func NewCachedTableConvertorGetter ¶ added in v0.1.2
func NewCachedTableConvertorGetter(getter TableConvertorGetter) TableConvertorGetter
NewCachedTableConvertorGetter 创建一个带缓存的 TableConvertorGetter
type TableConvertorGetterFunc ¶ added in v0.1.2
type TableConvertorGetterFunc func(obj runtime.Object) (registryrest.TableConvertor, error)
TableConvertorGetterFunc 获取指定对象的表格转换器方法
func (TableConvertorGetterFunc) TableConvertorForObject ¶ added in v0.1.2
func (getterFunc TableConvertorGetterFunc) TableConvertorForObject( obj runtime.Object, ) (registryrest.TableConvertor, error)
TableConvertorForObject 获取指定对象的表格转换器
type TableConvertorGetters ¶ added in v0.1.2
type TableConvertorGetters []TableConvertorGetter
TableConvertorGetters 是 TableConvertorGetter 的列表
func (TableConvertorGetters) TableConvertorForObject ¶ added in v0.1.2
func (getters TableConvertorGetters) TableConvertorForObject( obj runtime.Object, ) (registryrest.TableConvertor, error)
TableConvertorForObject 获取指定对象的表格转换器
type UNIXSocketListenerOptions ¶
type UNIXSocketListenerOptions struct {
Path string
}
UNIXSocketListenerOptions 监听 UNIX Socket 选项