ek8s

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const (
	KindPods      = "pods"
	KindEndpoints = "endpoints"
)
View Source
const PackageName = "component.ek8s"

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	*kubernetes.Clientset
	// contains filtered or unexported fields
}

Component ...

func (*Component) Config added in v0.2.0

func (c *Component) Config() Config

func (*Component) ListEndpoints

func (c *Component) ListEndpoints(option ListOptions) (endPoints []*v1.EndpointsList, err error)

func (*Component) ListEndpointsByName added in v0.2.3

func (c *Component) ListEndpointsByName(name string) (endPoints []*v1.Endpoints, err error)

func (*Component) ListPods added in v0.2.0

func (c *Component) ListPods(option ListOptions) (pods []*v1.PodList, err error)

func (*Component) ListPodsByName added in v0.2.3

func (c *Component) ListPodsByName(name string) (pods []*v1.Pod, err error)

func (*Component) NewWatcherApp added in v0.1.1

func (c *Component) NewWatcherApp(ctx context.Context, appName string, kind string) (app *WatcherApp, err error)

type Config

type Config struct {
	Addr                    string
	Debug                   bool
	Token                   string
	Namespaces              []string
	DeploymentPrefix        string // 命名前缀
	TLSClientConfigInsecure bool
}

Config ...

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig 返回默认配置

type Container

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

func DefaultContainer

func DefaultContainer() *Container

func Load

func Load(key string) *Container

func (*Container) Build

func (c *Container) Build(options ...Option) *Component

Build ...

type KubernetesEvent

type KubernetesEvent struct {
	IPs       []string
	EventType watch.EventType
}

type ListOptions added in v0.2.3

type ListOptions = metav1.ListOptions

type Option

type Option func(c *Container)

Option 可选项

func WithAddr

func WithAddr(addr string) Option

func WithDebug

func WithDebug(debug bool) Option

func WithDeploymentPrefix

func WithDeploymentPrefix(deploymentPrefix string) Option

func WithNamespaces

func WithNamespaces(namespaces []string) Option

func WithTLSClientConfigInsecure

func WithTLSClientConfigInsecure(insecure bool) Option

func WithToken

func WithToken(token string) Option

type WatcherApp added in v0.1.1

type WatcherApp struct {
	*kubernetes.Clientset
	// contains filtered or unexported fields
}

func (*WatcherApp) ProcessWorkItem added in v0.1.1

func (c *WatcherApp) ProcessWorkItem(f func(info *KubernetesEvent) error) bool

Directories

Path Synopsis
examples
kubegrpc/helloworld
Package helloworld is a generated protocol buffer package.
Package helloworld is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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