ek8s

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	KindPod       = "Pod"
	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) ListEndpoints

func (c *Component) ListEndpoints(appName string) (pods []*v1.Endpoints, err error)

func (*Component) ListPod

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

func (*Component) ProcessWorkItem

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

func (*Component) WatchPrefix

func (c *Component) WatchPrefix(ctx context.Context, appName string, kind string) (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 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

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