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.ServiceResource) ([]*model.ServiceResource, error)
- func (op Operator) GetEndpoints(ctx context.Context, res *model.ServiceResource) ([]types.ServiceResourceEndpoint, error)
- func (op Operator) GetKeys(ctx context.Context, res *model.ServiceResource) (*types.ServiceResourceOperationKeys, error)
- func (op Operator) GetStatus(ctx context.Context, res *model.ServiceResource) (*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.ServiceResource, 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.ConnectorTypeK8s
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 RestConfig *rest.Config Identifier string CoreCli *coreclient.CoreV1Client BatchCli *batchclient.BatchV1Client NetworkingCli *networkingclient.NetworkingV1Client DynamicCli *dynamicclient.DynamicClient }
func (Operator) GetComponents ¶
func (op Operator) GetComponents( ctx context.Context, res *model.ServiceResource, ) ([]*model.ServiceResource, error)
GetComponents implements operator.Operator.
func (Operator) GetEndpoints ¶
func (op Operator) GetEndpoints( ctx context.Context, res *model.ServiceResource, ) ([]types.ServiceResourceEndpoint, error)
GetEndpoints implements operator.Operator.
func (Operator) GetKeys ¶
func (op Operator) GetKeys( ctx context.Context, res *model.ServiceResource, ) (*types.ServiceResourceOperationKeys, error)
GetKeys implements operator.Operator.
func (Operator) GetStatus ¶
func (op Operator) GetStatus(ctx context.Context, res *model.ServiceResource) (*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.ServiceResource, labels map[string]string) error
Label implements operator.Operator.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.