Documentation ¶
Index ¶
- func DebugFactory(f *Factory, ns string, gvr string)
- func DumpFactory(f *Factory)
- type Factory
- func (f *Factory) AddForwarder(pf Forwarder)
- func (f *Factory) CanForResource(ns, gvr string, verbs []string) (informers.GenericInformer, error)
- func (f *Factory) Client() client.Connection
- func (f *Factory) DeleteForwarder(path string)
- func (f *Factory) FactoryFor(ns string) di.DynamicSharedInformerFactory
- func (f *Factory) ForResource(ns, gvr string) informers.GenericInformer
- func (f *Factory) ForwarderFor(path string) (Forwarder, bool)
- func (f *Factory) Forwarders() Forwarders
- func (f *Factory) Get(gvr, path string, wait bool, sel labels.Selector) (runtime.Object, error)
- func (f *Factory) List(gvr, ns string, wait bool, labels labels.Selector) ([]runtime.Object, error)
- func (f *Factory) SetActiveNS(ns string)
- func (f *Factory) Start(ns string)
- func (f *Factory) Terminate()
- func (f *Factory) WaitForCacheSync()
- type Forwarder
- type Forwarders
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory tracks various resource informers.
func NewFactory ¶
func NewFactory(client client.Connection) *Factory
NewFactory returns a new informers factory.
func (*Factory) AddForwarder ¶
AddForwarder registers a new portforward for a given container.
func (*Factory) CanForResource ¶
CanForResource return an informer is user has access.
func (*Factory) Client ¶
func (f *Factory) Client() client.Connection
Client return the factory connection.
func (*Factory) DeleteForwarder ¶
DeleteForwarder deletes portforward for a given container.
func (*Factory) FactoryFor ¶
func (f *Factory) FactoryFor(ns string) di.DynamicSharedInformerFactory
FactoryFor returns a factory for a given namespace.
func (*Factory) ForResource ¶
func (f *Factory) ForResource(ns, gvr string) informers.GenericInformer
ForResource returns an informer for a given resource.
func (*Factory) ForwarderFor ¶
ForwarderFor returns a portforward for a given container or nil if none exists.
func (*Factory) Forwarders ¶
func (f *Factory) Forwarders() Forwarders
Forwarders returns all portforwards.
func (*Factory) SetActiveNS ¶
SetActiveNS sets the active namespace.
func (*Factory) Terminate ¶
func (f *Factory) Terminate()
Terminate terminates all watchers and forwards.
func (*Factory) WaitForCacheSync ¶
func (f *Factory) WaitForCacheSync()
WaitForCacheSync waits for all factories to update their cache.
type Forwarder ¶
type Forwarder interface { // Start initializes a port forward. Start(path, co, address string, ports []string) (*portforward.PortForwarder, error) // Stop terminates a port forward. Stop() // Path returns a resource FQN. Path() string // Container returns a container name. Container() string // Ports returns container exposed ports. Ports() []string // Active returns forwarder current state. Active() bool // Age returns forwarder age. Age() string }
Forwarder represents a port forwarder.
type Forwarders ¶
Forwarders tracks active port forwards.
func (Forwarders) DeleteAll ¶
func (ff Forwarders) DeleteAll()
DeleteAll stops and delete all port-forwards.
func (Forwarders) Kill ¶
func (ff Forwarders) Kill(path string) int
Kill stops and delete a port-forwards associated with pod.