app

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION = "1.3.0"
)

Variables

This section is empty.

Functions

func AddCommonFlags

func AddCommonFlags(cmd *cobra.Command)

func GetBind

func GetBind(cmd *cobra.Command) (string, error)

func NewCompletionCommand added in v0.8.0

func NewCompletionCommand(f Factory) *cobra.Command

func NewGetCommand

func NewGetCommand(f Factory) *cobra.Command

func NewVersionCommand

func NewVersionCommand(f Factory) *cobra.Command

func NewWatchCommand

func NewWatchCommand(f Factory) *cobra.Command

func RunAlias added in v0.8.0

func RunAlias(f Factory, cmd *cobra.Command, args []string) error

func RunCommon

func RunCommon(cmd *cobra.Command) error

func RunGet

func RunGet(f Factory, cmd *cobra.Command, args []string) error

func RunWatch

func RunWatch(f Factory, cmd *cobra.Command, args []string) error

Types

type Cluster

type Cluster struct {
	Server               string `yaml:"server"`
	SkipVerify           bool   `yaml:"insecure-skip-tls-verify"`
	CertificateAuthority string `yaml:"certificate-authority"`
}

type ClusterWrap

type ClusterWrap struct {
	Name    string  `yaml:"name"`
	Cluster Cluster `yaml:"cluster"`
}

type Config

type Config struct {
	Clusters       []ClusterWrap `yaml:"clusters"`
	Contexts       []ContextWrap `yaml:"contexts"`
	Users          []UserWrap    `yaml:"users"`
	CurrentContext string        `yaml:"current-context"`
}

Config represent configuration written in .kube/config file

func GetKubeconfig added in v1.2.0

func GetKubeconfig(cmd *cobra.Command) (*Config, error)

func NewConfigFromURL added in v1.2.0

func NewConfigFromURL(url string) (*Config, error)

func (*Config) GenerateTLSConfig added in v1.2.0

func (cfg *Config) GenerateTLSConfig() (*tls.Config, error)

type Context

type Context struct {
	Cluster   string `yaml:"cluster"`
	Namespace string `yaml:"namespace"`
	User      string `yaml:"user"`
}

type ContextWrap

type ContextWrap struct {
	Name    string  `yaml:"name"`
	Context Context `yaml:"context"`
}

type DefaultFactory

type DefaultFactory struct {
	// contains filtered or unexported fields
}

func (*DefaultFactory) HomeKubeconfig

func (f *DefaultFactory) HomeKubeconfig() (Config, error)

func (*DefaultFactory) KubeClient

func (f *DefaultFactory) KubeClient(config *Config) KubeClient

func (*DefaultFactory) MrrCache

func (f *DefaultFactory) MrrCache() *MrrCache

func (*DefaultFactory) MrrClient

func (f *DefaultFactory) MrrClient(address string) (MrrClient, error)

func (*DefaultFactory) Serve

func (f *DefaultFactory) Serve(l net.Listener, cache *MrrCache) error

func (*DefaultFactory) StdOut

func (f *DefaultFactory) StdOut() io.Writer

type DefaultKubeClient

type DefaultKubeClient struct {
	// contains filtered or unexported fields
}

func (*DefaultKubeClient) GetObjects added in v0.9.0

func (kc *DefaultKubeClient) GetObjects(kind string) ([]KubeObject, error)

func (*DefaultKubeClient) Ping added in v1.2.1

func (kc *DefaultKubeClient) Ping() error

func (*DefaultKubeClient) Server

func (kc *DefaultKubeClient) Server() KubeServer

func (*DefaultKubeClient) WatchObjects

func (kc *DefaultKubeClient) WatchObjects(kind string, out chan *ObjectEvent) error

type EventType

type EventType string
const (
	Added    EventType = "ADDED"
	Modified EventType = "MODIFIED"
	Deleted  EventType = "DELETED"
)

type Factory

type Factory interface {
	KubeClient(config *Config) KubeClient
	MrrClient(bind string) (MrrClient, error)
	MrrCache() *MrrCache
	Serve(l net.Listener, c *MrrCache) error
	HomeKubeconfig() (Config, error)
	StdOut() io.Writer
}

func NewFactory

func NewFactory(stdOut io.Writer, kubeconfig *Config) Factory

type KubeClient

type KubeClient interface {
	Server() KubeServer
	Ping() error
	WatchObjects(kind string, out chan *ObjectEvent) error
	GetObjects(kind string) ([]KubeObject, error)
}

func NewKubeClient

func NewKubeClient(config *Config) KubeClient

NewKubeClient returns a client that talks to Kubenetes API server. It talks to only one server, and uses configuration of the current context in the given config

type KubeObject

type KubeObject struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`
}

type KubeServer

type KubeServer struct {
	URL string
}

KubeServer represents a Kubernetes API server which we ask for information

type KubeServers added in v1.0.0

type KubeServers []KubeServer

func (KubeServers) Len added in v1.0.0

func (s KubeServers) Len() int

func (KubeServers) Less added in v1.0.0

func (s KubeServers) Less(i, j int) bool

func (KubeServers) Swap added in v1.0.0

func (s KubeServers) Swap(i, j int)

type KubectlFlags added in v0.8.0

type KubectlFlags struct {
	// contains filtered or unexported fields
}

type MrrCache

type MrrCache struct {
	// contains filtered or unexported fields
}

func NewMrrCache

func NewMrrCache() *MrrCache

func (*MrrCache) Objects

func (c *MrrCache) Objects(f *MrrFilter, os *[]KubeObject) error

type MrrClient

type MrrClient interface {
	Objects(f MrrFilter) ([]KubeObject, error)
}

type MrrClientDefault

type MrrClientDefault struct {
	// contains filtered or unexported fields
}

func NewMrrClient

func NewMrrClient(address string) (*MrrClientDefault, error)

func (*MrrClientDefault) Objects

func (mc *MrrClientDefault) Objects(f MrrFilter) ([]KubeObject, error)

type MrrFilter

type MrrFilter struct {
	Server    string
	Namespace string
	Kind      string
}

type ObjectEvent

type ObjectEvent struct {
	Type   EventType   `json:"type"`
	Object *KubeObject `json:"object"`
}

type ObjectList added in v0.9.0

type ObjectList struct {
	Objects []KubeObject `json:"items"`
}

type ObjectMeta

type ObjectMeta struct {
	Name            string `json:"name,omitempty"`
	Namespace       string `json:"namespace,omitempty"`
	ResourceVersion string `json:"resourceVersion,omitempty"`
}

type TestFactory

type TestFactory struct {
	// contains filtered or unexported fields
}

func NewTestFactory

func NewTestFactory() *TestFactory

func (*TestFactory) HomeKubeconfig

func (f *TestFactory) HomeKubeconfig() (Config, error)

func (*TestFactory) KubeClient

func (f *TestFactory) KubeClient(config *Config) KubeClient

func (*TestFactory) MrrCache

func (f *TestFactory) MrrCache() *MrrCache

func (*TestFactory) MrrClient

func (f *TestFactory) MrrClient(address string) (MrrClient, error)

func (*TestFactory) Serve

func (f *TestFactory) Serve(l net.Listener, cache *MrrCache) error

func (*TestFactory) StdOut

func (f *TestFactory) StdOut() io.Writer

type TestKubeClient

type TestKubeClient struct {
	// contains filtered or unexported fields
}

func NewTestKubeClient

func NewTestKubeClient() *TestKubeClient

func (*TestKubeClient) GetObjects added in v0.9.0

func (kc *TestKubeClient) GetObjects(kind string) ([]KubeObject, error)

func (*TestKubeClient) Ping added in v1.2.1

func (kc *TestKubeClient) Ping() error

func (*TestKubeClient) Server

func (kc *TestKubeClient) Server() KubeServer

func (*TestKubeClient) WatchObjects

func (kc *TestKubeClient) WatchObjects(kind string, out chan *ObjectEvent) error

type TestMirrorClient

type TestMirrorClient struct {
	// contains filtered or unexported fields
}

func (*TestMirrorClient) Objects

func (mc *TestMirrorClient) Objects(f MrrFilter) ([]KubeObject, error)

type TypeMeta

type TypeMeta struct {
	Kind string `json:"kind,omitempty"`
}

type User added in v1.2.0

type User struct {
	ClientCertificate string `yaml:"client-certificate"`
	ClientKey         string `yaml:"client-key"`
}

type UserWrap added in v1.2.0

type UserWrap struct {
	Name string `yaml:"name"`
	User User   `yaml:"user"`
}

Jump to

Keyboard shortcuts

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