Documentation ¶
Index ¶
- Variables
- type AwsElasticBlockStore
- type Client
- type Collection
- type CollectionMeta
- type Container
- type ContainerPort
- type ContainerState
- type ContainerStateRunning
- type ContainerStateTerminated
- type ContainerStatus
- type Entity
- type EnvVar
- type Error404
- type Event
- type EventCollection
- type EventList
- type Events
- func (c *Events) Create(e *Event) (*Event, error)
- func (c *Events) Delete(name string) error
- func (c *Events) Get(name string) (*Event, error)
- func (c *Events) List() (*EventList, error)
- func (c *Events) Meta() *CollectionMeta
- func (c *Events) New() *Event
- func (c *Events) Query(q *QueryParams) (*EventList, error)
- func (c *Events) Update(name string, r *Event) (*Event, error)
- type HeapsterStatMetric
- type HeapsterStatPeriods
- type HeapsterStats
- type ImagePullSecret
- type Metadata
- type Namespace
- type NamespaceCollection
- type NamespaceList
- type Namespaces
- func (c *Namespaces) Create(e *Namespace) (*Namespace, error)
- func (c *Namespaces) Delete(name string) error
- func (c *Namespaces) Get(name string) (*Namespace, error)
- func (c *Namespaces) List() (*NamespaceList, error)
- func (c *Namespaces) Meta() *CollectionMeta
- func (c *Namespaces) New() *Namespace
- func (c *Namespaces) Query(q *QueryParams) (*NamespaceList, error)
- func (c *Namespaces) Update(name string, r *Namespace) (*Namespace, error)
- type Node
- type NodeAddress
- type NodeCollection
- type NodeList
- type NodeSpec
- type NodeStatus
- type NodeStatusCapacity
- type NodeStatusCondition
- type Nodes
- func (c *Nodes) Create(e *Node) (*Node, error)
- func (c *Nodes) Delete(name string) error
- func (c *Nodes) Get(name string) (*Node, error)
- func (c *Nodes) List() (*NodeList, error)
- func (c *Nodes) Meta() *CollectionMeta
- func (c *Nodes) New() *Node
- func (c *Nodes) Query(q *QueryParams) (*NodeList, error)
- func (c *Nodes) Update(name string, r *Node) (*Node, error)
- type Pod
- type PodCollection
- type PodList
- type PodSpec
- type PodStatus
- type PodStatusCondition
- type PodTemplate
- type Pods
- func (c *Pods) Create(e *Pod) (*Pod, error)
- func (c *Pods) Delete(name string) error
- func (c *Pods) Get(name string) (*Pod, error)
- func (c *Pods) List() (*PodList, error)
- func (c *Pods) Meta() *CollectionMeta
- func (c *Pods) New() *Pod
- func (c *Pods) Query(q *QueryParams) (*PodList, error)
- func (c *Pods) Update(name string, r *Pod) (*Pod, error)
- type QueryParams
- type RealClient
- func (c *RealClient) Delete() *Request
- func (c *RealClient) Events(namespace string) EventCollection
- func (c *RealClient) Get() *Request
- func (c *RealClient) Namespaces() NamespaceCollection
- func (c *RealClient) Nodes() NodeCollection
- func (c *RealClient) Patch() *Request
- func (c *RealClient) Pods(namespace string) PodCollection
- func (c *RealClient) Post() *Request
- func (c *RealClient) ReplicationControllers(namespace string) ReplicationControllerCollection
- func (c *RealClient) Secrets(namespace string) SecretCollection
- func (c *RealClient) Services(namespace string) ServiceCollection
- type ReplicationController
- type ReplicationControllerCollection
- type ReplicationControllerList
- type ReplicationControllerSpec
- type ReplicationControllerStatus
- type ReplicationControllers
- func (c *ReplicationControllers) Create(e *ReplicationController) (*ReplicationController, error)
- func (c *ReplicationControllers) Delete(name string) error
- func (c *ReplicationControllers) Get(name string) (*ReplicationController, error)
- func (c *ReplicationControllers) List() (*ReplicationControllerList, error)
- func (c *ReplicationControllers) Meta() *CollectionMeta
- func (c *ReplicationControllers) New() *ReplicationController
- func (c *ReplicationControllers) Query(q *QueryParams) (*ReplicationControllerList, error)
- func (c *ReplicationControllers) Update(name string, r *ReplicationController) (*ReplicationController, error)
- type Request
- func (r *Request) Body() (string, error)
- func (r *Request) Collection(c Collection) *Request
- func (r *Request) Do() *Request
- func (r *Request) Entity(e Entity) *Request
- func (r *Request) Into(e Entity) error
- func (r *Request) Name(name string) *Request
- func (r *Request) Namespace(namespace string) *Request
- func (r *Request) Path(path string) *Request
- func (r *Request) Query(q *QueryParams) *Request
- func (r *Request) String() string
- type ResourceDefinition
- type ResourceValues
- type Resources
- type Secret
- type SecretCollection
- type SecretList
- type Secrets
- func (c *Secrets) Create(e *Secret) (*Secret, error)
- func (c *Secrets) Delete(name string) error
- func (c *Secrets) Get(name string) (*Secret, error)
- func (c *Secrets) List() (*SecretList, error)
- func (c *Secrets) Meta() *CollectionMeta
- func (c *Secrets) New() *Secret
- func (c *Secrets) Query(q *QueryParams) (*SecretList, error)
- func (c *Secrets) Update(name string, r *Secret) (*Secret, error)
- type SecurityContext
- type Service
- type ServiceCollection
- type ServiceList
- type ServicePort
- type ServiceSpec
- type Services
- func (c *Services) Create(e *Service) (*Service, error)
- func (c *Services) Delete(name string) error
- func (c *Services) Get(name string) (*Service, error)
- func (c *Services) List() (*ServiceList, error)
- func (c *Services) Meta() *CollectionMeta
- func (c *Services) New() *Service
- func (c *Services) Query(q *QueryParams) (*ServiceList, error)
- func (c *Services) Update(name string, r *Service) (*Service, error)
- type Source
- type Volume
- type VolumeMount
Constants ¶
This section is empty.
Variables ¶
var Log *logger
Functions ¶
This section is empty.
Types ¶
type AwsElasticBlockStore ¶
type AwsElasticBlockStore struct { VolumeID string `json:"volumeID"` FSType string `json:"fsType"` }
Pod ==============================================================================
type Client ¶
type Client interface { // Namespaces returns a NamespaceCollection. Namespaces() NamespaceCollection // Events returns a EventCollection. Events(namespace string) EventCollection // Secrets returns a SecretCollection. Secrets(namespace string) SecretCollection // Services returns a ServiceCollection. Services(namespace string) ServiceCollection // ReplicationControllers returns a ReplicationControllerCollection. ReplicationControllers(namespace string) ReplicationControllerCollection // Pods returns a PodCollection. Pods(namespace string) PodCollection // Nodes returns a NodeCollection. Nodes() NodeCollection }
Client describes behavior of the root Kubernetes client object.
type Collection ¶
type Collection interface {
Meta() *CollectionMeta
}
Collection defines an interface for collections of Kubernetes resources.
type CollectionMeta ¶
type CollectionMeta struct { DomainName string // empty unless something like ThirdPartyResource APIGroup string // usually "api" APIVersion string // usually "v1" APIName string // e.g. "replicationcontrollers" Kind string // e.g. "ReplicationController" }
CollectionMeta holds info required by all Kubernetes Resources defined.
type Container ¶
type Container struct { Name string `json:"name"` Image string `json:"image"` Command []string `json:"command"` Resources *Resources `json:"resources"` Ports []*ContainerPort `json:"ports"` VolumeMounts []*VolumeMount `json:"volumeMounts"` Env []*EnvVar `json:"env"` SecurityContext *SecurityContext `json:"securityContext"` ImagePullPolicy string `json:"imagePullPolicy"` }
type ContainerPort ¶
type ContainerState ¶
type ContainerState struct { Running *ContainerStateRunning `json:"running"` Terminated *ContainerStateTerminated `json:"terminated"` }
type ContainerStateRunning ¶
type ContainerStateRunning struct {
StartedAt string `json:"startedAt"` // TODO should be time type
}
type ContainerStatus ¶
type ContainerStatus struct { ContainerID string `json:"containerID"` Image string `json:"image"` ImageID string `json:"imageID"` Name string `json:"name"` Ready bool `json:"ready"` RestartCount int `json:"restartCount"` State *ContainerState `json:"state"` LastState *ContainerState `json:"state"` }
type Event ¶
type Event struct { *ResourceDefinition Metadata *Metadata `json:"metadata"` Message string `json:"message"` Count int `json:"count"` Source *Source `json:"source"` // contains filtered or unexported fields }
type EventCollection ¶
type EventCollection interface { Meta() *CollectionMeta New() *Event Create(e *Event) (*Event, error) Query(q *QueryParams) (*EventList, error) List() (*EventList, error) Get(name string) (*Event, error) Update(name string, r *Event) (*Event, error) Delete(name string) error }
EventCollection is a Collection interface for Events.
type Events ¶
type Events struct { Namespace string // contains filtered or unexported fields }
Events implmenets EventCollection.
func (*Events) Meta ¶
func (c *Events) Meta() *CollectionMeta
Meta implements the Collection interface.
type HeapsterStatMetric ¶
type HeapsterStatPeriods ¶
type HeapsterStatPeriods struct { Minute *HeapsterStatMetric `json:"minute"` Hour *HeapsterStatMetric `json:"hour"` Day *HeapsterStatMetric `json:"day"` }
type HeapsterStats ¶
type HeapsterStats struct { Uptime int `json:"uptime"` Stats map[string]*HeapsterStatPeriods }
type ImagePullSecret ¶
type ImagePullSecret struct {
Name string `json:"name"`
}
type Namespace ¶
type Namespace struct { *ResourceDefinition Metadata *Metadata `json:"metadata"` // contains filtered or unexported fields }
Namespace ==============================================================================
type NamespaceCollection ¶
type NamespaceCollection interface { Meta() *CollectionMeta New() *Namespace Create(e *Namespace) (*Namespace, error) Query(q *QueryParams) (*NamespaceList, error) List() (*NamespaceList, error) Get(name string) (*Namespace, error) Update(name string, r *Namespace) (*Namespace, error) Delete(name string) error }
NamespaceCollection is a Collection interface for Namespaces.
type NamespaceList ¶
type NamespaceList struct {
Items []*Namespace `json:"items"`
}
type Namespaces ¶
type Namespaces struct {
// contains filtered or unexported fields
}
Namespaces implements NamespaceCollection.
func (*Namespaces) Delete ¶
func (c *Namespaces) Delete(name string) error
func (*Namespaces) List ¶
func (c *Namespaces) List() (*NamespaceList, error)
func (*Namespaces) Meta ¶
func (c *Namespaces) Meta() *CollectionMeta
Meta implements the Collection interface.
func (*Namespaces) New ¶
func (c *Namespaces) New() *Namespace
func (*Namespaces) Query ¶
func (c *Namespaces) Query(q *QueryParams) (*NamespaceList, error)
type Node ¶
type Node struct { *ResourceDefinition Metadata *Metadata `json:"metadata"` Spec *NodeSpec `json:"spec"` Status *NodeStatus `json:"status"` // contains filtered or unexported fields }
func (*Node) ExternalIP ¶
func (*Node) HeapsterStats ¶
func (r *Node) HeapsterStats() (*HeapsterStats, error)
func (*Node) IsOutOfDisk ¶
type NodeAddress ¶
type NodeCollection ¶
type NodeCollection interface { Meta() *CollectionMeta New() *Node Create(e *Node) (*Node, error) Query(q *QueryParams) (*NodeList, error) List() (*NodeList, error) Get(name string) (*Node, error) Update(name string, r *Node) (*Node, error) Delete(name string) error }
NodeCollection is a Collection interface for Nodes.
type NodeSpec ¶
type NodeSpec struct {
ExternalID string `json:"externalID"`
}
Node ==============================================================================
type NodeStatus ¶
type NodeStatus struct { Capacity *NodeStatusCapacity `json:"capacity"` Conditions []*NodeStatusCondition `json:"conditions"` Addresses []*NodeAddress `json:"addresses"` }
type NodeStatusCapacity ¶
type NodeStatusCondition ¶
type Nodes ¶
type Nodes struct {
// contains filtered or unexported fields
}
Nodes implmenets NodeCollection.
func (*Nodes) Meta ¶
func (c *Nodes) Meta() *CollectionMeta
Meta implements the Collection interface.
type Pod ¶
type Pod struct { *ResourceDefinition Metadata *Metadata `json:"metadata"` Spec *PodSpec `json:"spec"` Status *PodStatus `json:"status"` // contains filtered or unexported fields }
func (*Pod) HeapsterStats ¶
func (r *Pod) HeapsterStats() (*HeapsterStats, error)
type PodCollection ¶
type PodCollection interface { Meta() *CollectionMeta New() *Pod Create(e *Pod) (*Pod, error) Query(q *QueryParams) (*PodList, error) List() (*PodList, error) Get(name string) (*Pod, error) Update(name string, r *Pod) (*Pod, error) Delete(name string) error }
PodCollection is a Collection interface for Pods.
type PodSpec ¶
type PodSpec struct { Volumes []*Volume `json:"volumes"` Containers []*Container `json:"containers"` ImagePullSecrets []*ImagePullSecret `json:"imagePullSecrets"` TerminationGracePeriodSeconds int `json:"terminationGracePeriodSeconds"` RestartPolicy string `json:"restartPolicy"` }
type PodStatus ¶
type PodStatus struct { Phase string `json:"phase"` Conditions []*PodStatusCondition `json:"conditions"` ContainerStatuses []*ContainerStatus `json:"containerStatuses"` }
type PodStatusCondition ¶
type PodTemplate ¶
ReplicationController ==============================================================================
type Pods ¶
type Pods struct { Namespace string // contains filtered or unexported fields }
Pods implmenets PodCollection.
type QueryParams ¶
TODO not sure if this should be in the types file.. related to queries, but is a Kube-specific thing
type RealClient ¶
type RealClient struct { Host string Username string Password string // contains filtered or unexported fields }
RealClient implements Client.
func (*RealClient) Delete ¶
func (c *RealClient) Delete() *Request
Delete performs a DELETE request against a Client object.
func (*RealClient) Events ¶
func (c *RealClient) Events(namespace string) EventCollection
Events returns a Events object from a Client object.
func (*RealClient) Get ¶
func (c *RealClient) Get() *Request
Get performs a GET request against a Client object.
func (*RealClient) Namespaces ¶
func (c *RealClient) Namespaces() NamespaceCollection
Namespaces returns a Namespaces object from a Client object.
func (*RealClient) Nodes ¶
func (c *RealClient) Nodes() NodeCollection
Namespaces returns a Nodes object from a Client object.
func (*RealClient) Patch ¶
func (c *RealClient) Patch() *Request
Patch performs a PATCH request against a Client object.
func (*RealClient) Pods ¶
func (c *RealClient) Pods(namespace string) PodCollection
Pods returns a Pods object from a Client object.
func (*RealClient) Post ¶
func (c *RealClient) Post() *Request
Post performs a POST request against a Client object.
func (*RealClient) ReplicationControllers ¶
func (c *RealClient) ReplicationControllers(namespace string) ReplicationControllerCollection
ReplicationControllers returns a ReplicationControllers object from a Client object.
func (*RealClient) Secrets ¶
func (c *RealClient) Secrets(namespace string) SecretCollection
Secrets returns a Secrets object from a Client object.
func (*RealClient) Services ¶
func (c *RealClient) Services(namespace string) ServiceCollection
Services returns a Services object from a Client object.
type ReplicationController ¶
type ReplicationController struct { *ResourceDefinition Metadata *Metadata `json:"metadata"` Spec *ReplicationControllerSpec `json:"spec"` Status *ReplicationControllerStatus `json:"status,omitempty"` // contains filtered or unexported fields }
func (*ReplicationController) Delete ¶
func (r *ReplicationController) Delete() error
func (*ReplicationController) Reload ¶
func (r *ReplicationController) Reload() (*ReplicationController, error)
func (*ReplicationController) Save ¶
func (r *ReplicationController) Save() error
type ReplicationControllerCollection ¶
type ReplicationControllerCollection interface { Meta() *CollectionMeta New() *ReplicationController Create(e *ReplicationController) (*ReplicationController, error) Query(q *QueryParams) (*ReplicationControllerList, error) List() (*ReplicationControllerList, error) Get(name string) (*ReplicationController, error) Update(name string, r *ReplicationController) (*ReplicationController, error) Delete(name string) error }
ReplicationControllerCollection is a Collection interface for ReplicationControllers.
type ReplicationControllerList ¶
type ReplicationControllerList struct {
Items []*ReplicationController `json:"items"`
}
type ReplicationControllerSpec ¶
type ReplicationControllerSpec struct { Selector map[string]string `json:"selector"` Replicas int `json:"replicas"` Template *PodTemplate `json:"template"` }
type ReplicationControllerStatus ¶
type ReplicationControllerStatus struct {
Replicas int `json:"replicas"`
}
type ReplicationControllers ¶
type ReplicationControllers struct { Namespace string // contains filtered or unexported fields }
ReplicationControllers implmenets ReplicationControllerCollection.
func (*ReplicationControllers) Create ¶
func (c *ReplicationControllers) Create(e *ReplicationController) (*ReplicationController, error)
func (*ReplicationControllers) Delete ¶
func (c *ReplicationControllers) Delete(name string) error
func (*ReplicationControllers) Get ¶
func (c *ReplicationControllers) Get(name string) (*ReplicationController, error)
func (*ReplicationControllers) List ¶
func (c *ReplicationControllers) List() (*ReplicationControllerList, error)
func (*ReplicationControllers) Meta ¶
func (c *ReplicationControllers) Meta() *CollectionMeta
Meta implements the Collection interface.
func (*ReplicationControllers) New ¶
func (c *ReplicationControllers) New() *ReplicationController
func (*ReplicationControllers) Query ¶
func (c *ReplicationControllers) Query(q *QueryParams) (*ReplicationControllerList, error)
func (*ReplicationControllers) Update ¶
func (c *ReplicationControllers) Update(name string, r *ReplicationController) (*ReplicationController, error)
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) Collection ¶
func (r *Request) Collection(c Collection) *Request
func (*Request) Query ¶
func (r *Request) Query(q *QueryParams) *Request
type ResourceDefinition ¶
Common ==============================================================================
type ResourceValues ¶
type Resources ¶
type Resources struct { Limits *ResourceValues `json:"limits"` Requests *ResourceValues `json:"requests"` }
type Secret ¶
type Secret struct { *ResourceDefinition Metadata *Metadata `json:"metadata"` Type string `json:"type"` Data map[string]string `json:"data"` // contains filtered or unexported fields }
Secret ==============================================================================
type SecretCollection ¶
type SecretCollection interface { Meta() *CollectionMeta New() *Secret Create(e *Secret) (*Secret, error) Query(q *QueryParams) (*SecretList, error) List() (*SecretList, error) Get(name string) (*Secret, error) Update(name string, r *Secret) (*Secret, error) Delete(name string) error }
SecretCollection is a Collection interface for Secrets.
type SecretList ¶
type SecretList struct {
Items []*Secret `json:"items"`
}
type Secrets ¶
type Secrets struct { Namespace string // contains filtered or unexported fields }
Secrets implmenets SecretCollection.
func (*Secrets) List ¶
func (c *Secrets) List() (*SecretList, error)
func (*Secrets) Meta ¶
func (c *Secrets) Meta() *CollectionMeta
Meta implements the Collection interface.
func (*Secrets) Query ¶
func (c *Secrets) Query(q *QueryParams) (*SecretList, error)
type SecurityContext ¶
type SecurityContext struct {
Privileged bool `json:"privileged"`
}
type Service ¶
type Service struct { *ResourceDefinition Metadata *Metadata `json:"metadata"` Spec *ServiceSpec `json:"spec"` // contains filtered or unexported fields }
type ServiceCollection ¶
type ServiceCollection interface { Meta() *CollectionMeta New() *Service Create(e *Service) (*Service, error) Query(q *QueryParams) (*ServiceList, error) List() (*ServiceList, error) Get(name string) (*Service, error) Update(name string, r *Service) (*Service, error) Delete(name string) error }
ServiceCollection is a Collection interface for Services.
type ServiceList ¶
type ServiceList struct {
Items []*Service `json:"items"`
}
type ServicePort ¶
type ServicePort struct { Name string `json:"name"` Port int `json:"port"` Protocol string `json:"protocol,omitempty"` NodePort int `json:"nodePort,omitempty"` TargetPort int `json:"targetPort,omitempty"` }
Service ==============================================================================
type ServiceSpec ¶
type ServiceSpec struct { Type string `json:"type,omitempty"` Selector map[string]string `json:"selector"` Ports []*ServicePort `json:"ports"` ClusterIP string `json:"clusterIP,omitempty"` }
type Services ¶
type Services struct { Namespace string // contains filtered or unexported fields }
Services implmenets ServiceCollection.
func (*Services) List ¶
func (c *Services) List() (*ServiceList, error)
func (*Services) Meta ¶
func (c *Services) Meta() *CollectionMeta
Meta implements the Collection interface.
func (*Services) Query ¶
func (c *Services) Query(q *QueryParams) (*ServiceList, error)
type Source ¶
type Source struct {
Host string `json:"host"`
}
Event ==============================================================================
type Volume ¶
type Volume struct { Name string `json:"name"` AwsElasticBlockStore *AwsElasticBlockStore `json:"awsElasticBlockStore"` }