Documentation ¶
Index ¶
- Constants
- func NewConnecterProxy(transport http.RoundTripper, upstreamMaster *url.URL) (rest.Storage, error)
- func NewRESTStorageProviders(apiGroupConfigs ...common.APIGroupConfig) ([]master.RESTStorageProvider, error)
- func NewStoragesForGV(cfgs map[string]*common.StorageConfig) (map[string]rest.Storage, error)
- func NewTenantProxy(config common.StorageConfig) (rest.Storage, error)
- type ConnecterProxy
- func (cp *ConnecterProxy) Connect(ctx context.Context, id string, options runtime.Object, r rest.Responder) (http.Handler, error)
- func (cp *ConnecterProxy) ConnectMethods() []string
- func (cp *ConnecterProxy) New() runtime.Object
- func (cp *ConnecterProxy) NewConnectOptions() (runtime.Object, bool, string)
- type DiscoveryProxy
- type FancyResponseWriterDelegator
- type RESTStorageProvider
- type ResponseWriterDelegator
Constants ¶
const ( LogSubresource = "log" Namespace = "namespaces" )
Variables ¶
This section is empty.
Functions ¶
func NewConnecterProxy ¶
func NewRESTStorageProviders ¶
func NewRESTStorageProviders(apiGroupConfigs ...common.APIGroupConfig) ([]master.RESTStorageProvider, error)
NewRESTStorageProviders returns providers of rest storage.
func NewStoragesForGV ¶
NewStoragesForGV returns a rest storage for group version.
func NewTenantProxy ¶
func NewTenantProxy(config common.StorageConfig) (rest.Storage, error)
NewTenantProxy returns the tenant proxy which implements the storage intefaces.
Types ¶
type ConnecterProxy ¶
type ConnecterProxy struct {
// contains filtered or unexported fields
}
func (*ConnecterProxy) Connect ¶
func (cp *ConnecterProxy) Connect(ctx context.Context, id string, options runtime.Object, r rest.Responder) (http.Handler, error)
Connect proxy the connection to the upstream server if shoud proxy.
func (*ConnecterProxy) ConnectMethods ¶
func (cp *ConnecterProxy) ConnectMethods() []string
func (*ConnecterProxy) New ¶
func (cp *ConnecterProxy) New() runtime.Object
func (*ConnecterProxy) NewConnectOptions ¶
func (cp *ConnecterProxy) NewConnectOptions() (runtime.Object, bool, string)
type DiscoveryProxy ¶
type DiscoveryProxy interface { // ServerGroups returns the supported groups for tenant, with information like supported versions and the // preferred version. ServerGroups(tenantID string) (*metav1.APIGroupList, error) // ServerVersionsForGroup returns the supported versions and the preferred version of a group for tenant. ServerVersionsForGroup(tenantID, group string) (*metav1.APIGroup, error) // ServerResourcesForGroupVersion returns the supported resources for a group and version for tenant. ServerResourcesForGroupVersion(tenantID, group, version string) (*metav1.APIResourceList, error) // ServerVersion retrieves and parses the server's version (git version). ServerVersion() (*version.Info, error) // OpenAPISchema fetches the open api schema using a rest client and parses the proto. OpenAPISchema() (*openapi_v2.Document, error) // GetSwagger fetches swagger API specification GetSwagger() (*spec.Swagger, error) }
func NewDiscoveryProxy ¶
func NewDiscoveryProxy(discoveryClient *discovery.DiscoveryClient, crdLister v1.CustomResourceDefinitionLister) (DiscoveryProxy, error)
type FancyResponseWriterDelegator ¶
type FancyResponseWriterDelegator struct {
*ResponseWriterDelegator
}
func (*FancyResponseWriterDelegator) CloseNotify ¶
func (f *FancyResponseWriterDelegator) CloseNotify() <-chan bool
CloseNotify returns a channel that receives at most a single value (true) when the client connection has gone away.
func (*FancyResponseWriterDelegator) Flush ¶
func (f *FancyResponseWriterDelegator) Flush()
Flush sends any buffered data to the client.
func (*FancyResponseWriterDelegator) Hijack ¶
func (f *FancyResponseWriterDelegator) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack lets the caller take over the connection.
type RESTStorageProvider ¶
type RESTStorageProvider struct {
// contains filtered or unexported fields
}
func (RESTStorageProvider) GroupName ¶
func (r RESTStorageProvider) GroupName() string
GroupName returns the group name of the api group.
func (RESTStorageProvider) NewRESTStorage ¶
func (r RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (genericapiserver.APIGroupInfo, error)
NewRESTStorage returns a rest storage.
type ResponseWriterDelegator ¶
type ResponseWriterDelegator struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriterDelegator interface wraps http.ResponseWriter to additionally record content-length, status-code, etc.
func (*ResponseWriterDelegator) ContentLength ¶
func (r *ResponseWriterDelegator) ContentLength() int
ContentLength return the length of http response content.
func (*ResponseWriterDelegator) Status ¶
func (r *ResponseWriterDelegator) Status() int
Status return the http response status.
func (*ResponseWriterDelegator) Write ¶
func (r *ResponseWriterDelegator) Write(b []byte) (int, error)
Write writes the data to the connection as part of an HTTP reply.
func (*ResponseWriterDelegator) WriteHeader ¶
func (r *ResponseWriterDelegator) WriteHeader(code int)
WriteHeader sends an HTTP response header with the provided status code.