Documentation
¶
Index ¶
- Variables
- func NormalizeError(err error) error
- func ObjectType(o interface{}) string
- type Category
- type Client
- func (c *Client) DeleteObject(ctx context.Context, object ObjectMetaGetter, timeout time.Duration) error
- func (c *Client) Events(ctx context.Context, obj ObjectMetaGetter) ([]cv1.Event, error)
- func (c *Client) Logs(ctx context.Context, object ObjectMetaGetter, container string, ...) (<-chan []byte, error)
- func (c *Client) Namespaces(ctx context.Context) ([]string, error)
- func (c *Client) PodTree(ctx context.Context, nsName string) (PodTree, error)
- func (c *Client) PodTreeWatcher(ctx context.Context, nsName string) (<-chan PodWatcherEvent, error)
- func (c *Client) RegisterControllerOperator(kind ControllerType, op ControllerOperator)
- func (c *Client) RestClient(uri string) (*rest.RESTClient, error)
- func (c *Client) ResultToObject(result rest.Result) (ObjectMetaGetter, error)
- func (c *Client) ResultToObjectList(result rest.Result) ([]GenericObj, error)
- func (c *Client) ScaleDeployment(ctx context.Context, o Controller, replicas int) error
- func (c *Client) UpdateObject(ctx context.Context, object ObjectMetaGetter, data []byte) error
- type Controller
- type ControllerDelete
- type ControllerFactory
- type ControllerGenerator
- type ControllerList
- type ControllerOperator
- type ControllerOperators
- type ControllerType
- type ControllerUpdate
- type ControllerWatch
- type Controllers
- type Ctrl
- type ErrMultipleContainers
- type ErrReason
- type GenericObj
- type GenericObjList
- type ObjectMetaGetter
- type PodManager
- type PodTree
- type PodWatcherEvent
- type Pods
- type Selector
- type UnsupportedObjectError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrForbidden = errors.New("Forbidden")
Functions ¶
func NormalizeError ¶
func ObjectType ¶
func ObjectType(o interface{}) string
Types ¶
type Client ¶
type Client struct { *kubernetes.Clientset // contains filtered or unexported fields }
Client provides functions around the k8s clientset api.
func New ¶
New returns a new k8s Client, using the kubeconfig specified by the path, or by reading the KUBECONFIG environment variable.
func (*Client) DeleteObject ¶
func (*Client) PodTreeWatcher ¶
func (*Client) RegisterControllerOperator ¶
func (c *Client) RegisterControllerOperator(kind ControllerType, op ControllerOperator)
func (*Client) RestClient ¶
func (c *Client) RestClient(uri string) (*rest.RESTClient, error)
func (*Client) ResultToObject ¶
func (c *Client) ResultToObject(result rest.Result) (ObjectMetaGetter, error)
func (*Client) ResultToObjectList ¶
func (c *Client) ResultToObjectList(result rest.Result) ([]GenericObj, error)
func (*Client) ScaleDeployment ¶
func (*Client) UpdateObject ¶
type Controller ¶
type Controller interface { PodManager ObjectMetaGetter Controller() ObjectMetaGetter Category() Category Selector() Selector DeepCopy() Controller }
type ControllerDelete ¶
type ControllerDelete func(c *Client, obj ObjectMetaGetter, opts meta.DeleteOptions) error
type ControllerFactory ¶
type ControllerFactory func(o ObjectMetaGetter, tree PodTree) Controller
type ControllerGenerator ¶
type ControllerGenerator func(tree PodTree) Controllers
type ControllerList ¶
type ControllerList func(c *Client, ns string, opts meta.ListOptions) ( ControllerGenerator, error, )
type ControllerOperator ¶
type ControllerOperator struct { Factory ControllerFactory List ControllerList Watch ControllerWatch Update ControllerUpdate Delete ControllerDelete }
type ControllerOperators ¶
type ControllerOperators map[ControllerType]ControllerOperator
func (ControllerOperators) Types ¶
func (c ControllerOperators) Types() []ControllerType
type ControllerType ¶
type ControllerType string
const ( StatefulSetType ControllerType = "StatefulSet" DeploymentType ControllerType = "Deployment" DaemonSetType ControllerType = "DaemonSet" JobType ControllerType = "Job" CronJobType ControllerType = "CronJob" ServiceType ControllerType = "Service" )
type ControllerUpdate ¶
type ControllerUpdate func(c *Client, obj ObjectMetaGetter) error
type ControllerWatch ¶
type Controllers ¶
type Controllers []Controller
func (Controllers) DeepCopy ¶
func (c Controllers) DeepCopy() Controllers
type Ctrl ¶
type Ctrl struct { ObjectMetaGetter // contains filtered or unexported fields }
func NewCtrlWithPods ¶
func NewCtrlWithPods(o ObjectMetaGetter, category Category, selector Selector, pods Pods) *Ctrl
func NewGenericCtrl ¶
func NewGenericCtrl(o ObjectMetaGetter, category Category, selector Selector, tree PodTree) *Ctrl
func NewInheritCtrl ¶
func NewInheritCtrl(o ObjectMetaGetter, category Category, tree PodTree) *Ctrl
func (*Ctrl) Controller ¶
func (c *Ctrl) Controller() ObjectMetaGetter
func (*Ctrl) DeepCopy ¶
func (c *Ctrl) DeepCopy() Controller
type ErrMultipleContainers ¶
type ErrMultipleContainers struct { Containers []string // contains filtered or unexported fields }
type GenericObj ¶
type GenericObj struct { meta.TypeMeta `json:",inline"` meta.ObjectMeta `json:"metadata,omitempty"` Spec map[string]interface{} `json:"spec,omitempty"` Data map[string]interface{} `json:"data,omitempty"` Status map[string]interface{} `json:"status,omitempty"` Other map[string]interface{} `json:"other-unknown,omitempty"` }
func (*GenericObj) UnmarshalJSON ¶
func (o *GenericObj) UnmarshalJSON(data []byte) error
type GenericObjList ¶
type GenericObjList struct {
Items []GenericObj `json:"items"`
}
type ObjectMetaGetter ¶
type ObjectMetaGetter interface { GetObjectMeta() meta.Object GetObjectKind() schema.ObjectKind }
type PodManager ¶
type PodTree ¶
type PodTree struct { Controllers Controllers // contains filtered or unexported fields }
type PodWatcherEvent ¶
type UnsupportedObjectError ¶
type UnsupportedObjectError struct {
TypeName string
}
func (UnsupportedObjectError) Error ¶
func (e UnsupportedObjectError) Error() string
Click to show internal directories.
Click to hide internal directories.