Documentation ¶
Index ¶
- Constants
- func GetConfig(conn model.Connector, opts ...ConfigOption) (restConfig *rest.Config, err error)
- func GetPodLogs(ctx context.Context, cli *coreclient.CoreV1Client, namespace string, ...) error
- func LoadApiConfig(conn model.Connector) (apiConfig *api.Config, raw string, err error)
- func New(ctx context.Context, opts optypes.CreateOptions) (optypes.Operator, error)
- type ConfigOption
- type Operator
- func (op Operator) Burst() int
- func (op Operator) Exec(ctx context.Context, k string, opts optypes.ExecOptions) error
- func (op Operator) GetComponents(ctx context.Context, res *model.ResourceComponent) ([]*model.ResourceComponent, error)
- func (op Operator) GetKeys(ctx context.Context, res *model.ResourceComponent) (*types.ResourceComponentOperationKeys, error)
- func (op Operator) GetStatus(ctx context.Context, res *model.ResourceComponent) (*status.Status, error)
- func (op Operator) ID() string
- func (op Operator) IsConnected(ctx context.Context) error
- func (op Operator) Label(ctx context.Context, res *model.ResourceComponent, labels map[string]string) error
- func (op Operator) Log(ctx context.Context, k string, opts optypes.LogOptions) error
- func (Operator) Type() optypes.Type
Constants ¶
View Source
const OperatorType = types.ConnectorTypeKubernetes
Variables ¶
This section is empty.
Functions ¶
func GetConfig ¶
GetConfig returns the rest.Config with the given model, by default, the rest.Config configures with 15s timeout/16 qps/64 burst, please modify the default configuration with ConfigOption as need.
func GetPodLogs ¶
func GetPodLogs( ctx context.Context, cli *coreclient.CoreV1Client, namespace string, name string, w io.Writer, opts *core.PodLogOptions, ) error
GetPodLogs get the logs of a pod.
func LoadApiConfig ¶
LoadApiConfig returns the client api.Config with the given model.
Types ¶
type ConfigOption ¶
ConfigOption holds the modification to modify the return rest.Config.
func WithRateLimit ¶
func WithRateLimit(qps float32, burst int) ConfigOption
WithRateLimit sets rate limitation.
type Operator ¶
type Operator struct { Logger log.Logger Identifier string ModelClient model.ClientSet RestConfig *rest.Config CoreCli *coreclient.CoreV1Client BatchCli *batchclient.BatchV1Client NetworkingCli *networkingclient.NetworkingV1Client DynamicCli *dynamicclient.DynamicClient }
func (Operator) GetComponents ¶
func (op Operator) GetComponents( ctx context.Context, res *model.ResourceComponent, ) ([]*model.ResourceComponent, error)
GetComponents implements operator.Operator.
func (Operator) GetKeys ¶
func (op Operator) GetKeys( ctx context.Context, res *model.ResourceComponent, ) (*types.ResourceComponentOperationKeys, error)
GetKeys implements operator.Operator.
func (Operator) GetStatus ¶
func (op Operator) GetStatus(ctx context.Context, res *model.ResourceComponent) (*status.Status, error)
GetStatus implements operator.Operator.
func (Operator) IsConnected ¶
IsConnected implements operator.Operator.
func (Operator) Label ¶
func (op Operator) Label(ctx context.Context, res *model.ResourceComponent, labels map[string]string) error
Label implements operator.Operator.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.