context

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkPluginFlannel = "flannel"
	NetworkPluginCalico  = "calico"
	NetworkPluginTerway  = "terway"
)

Variables

View Source
var SkoopContext = &Context{
	Ctx: &sync.Map{},
}

Functions

func RegisterConfigBinder

func RegisterConfigBinder(name string, binder ConfigBinder)

Types

type ClusterConfig

type ClusterConfig struct {
	KubeConfigPath    string
	CloudProvider     string
	ClusterCIDRString string
	ClusterCIDR       *net.IPNet
	NetworkPlugin     string
	ProxyMode         string
	IPCache           *k8s.IPCache
}

func (*ClusterConfig) BindFlags

func (cc *ClusterConfig) BindFlags(fs *pflag.FlagSet)

func (*ClusterConfig) Validate

func (cc *ClusterConfig) Validate() error

type ConfigBinder

type ConfigBinder interface {
	BindFlags(fs *pflag.FlagSet)
	Validate() error
}

type Context

type Context struct {
	Ctx *sync.Map
}

func (*Context) BindFlags

func (c *Context) BindFlags(fs *pflag.FlagSet)

func (*Context) BindNamedFlags

func (c *Context) BindNamedFlags(fss *cliflag.NamedFlagSets)

func (*Context) BuildCluster

func (c *Context) BuildCluster() error

func (*Context) BuildTask

func (c *Context) BuildTask() error

func (*Context) ClusterConfig

func (c *Context) ClusterConfig() *ClusterConfig

func (*Context) KubernetesClient

func (c *Context) KubernetesClient() *kubernetes.Clientset

func (*Context) KubernetesRestClient

func (c *Context) KubernetesRestClient() *rest.Config

func (*Context) MiscConfig

func (c *Context) MiscConfig() *MiscConfig

func (*Context) TaskConfig

func (c *Context) TaskConfig() *TaskConfig

func (*Context) UIConfig

func (c *Context) UIConfig() *UIConfig

func (*Context) Validate

func (c *Context) Validate() error

type MiscConfig

type MiscConfig struct {
	Version bool
}

func (*MiscConfig) BindFlags

func (m *MiscConfig) BindFlags(fs *pflag.FlagSet)

func (*MiscConfig) Validate

func (m *MiscConfig) Validate() error

type NamedConfigBinder

type NamedConfigBinder struct {
	Name   string
	Binder ConfigBinder
}

type TaskConfig

type TaskConfig struct {
	Source      string `json:"source"`
	Destination struct {
		Address string `json:"address"`
		Port    uint16 `json:"port"`
	} `json:"destination"`
	SourceEndpoint model.Endpoint `json:"source_endpoint"`
	DstEndpoint    model.Endpoint `json:"dst_endpoint"`
	Protocol       string         `json:"protocol"`
}

func (*TaskConfig) BindFlags

func (tc *TaskConfig) BindFlags(fs *pflag.FlagSet)

func (*TaskConfig) Validate

func (tc *TaskConfig) Validate() error

type UIConfig

type UIConfig struct {
	Format      string
	Output      string
	HTTP        bool
	HTTPAddress string
	HTTPPort    uint
}

func (*UIConfig) BindFlags

func (c *UIConfig) BindFlags(fs *pflag.FlagSet)

func (*UIConfig) Validate

func (c *UIConfig) Validate() error

Jump to

Keyboard shortcuts

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