proxy

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogSubresource = "log"
	Namespace      = "namespaces"
)

Variables

This section is empty.

Functions

func NewConnecterProxy

func NewConnecterProxy(transport http.RoundTripper, upstreamMaster *url.URL) (rest.Storage, error)

func NewRESTStorageProviders

func NewRESTStorageProviders(apiGroupConfigs ...common.APIGroupConfig) ([]master.RESTStorageProvider, error)

NewRESTStorageProviders returns providers of rest storage.

func NewStoragesForGV

func NewStoragesForGV(cfgs map[string]*common.StorageConfig) (
	map[string]rest.Storage, error)

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

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL