tasks

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(opts *GenericOptions) *cobra.Command

func DefaultMarshalIndent

func DefaultMarshalIndent(value interface{}) ([]byte, error)

func NewGetCommand

func NewGetCommand(options *GenericOptions) *cobra.Command

func NewListCommand

func NewListCommand(options *GenericOptions) *cobra.Command

func NewRestartCommand

func NewRestartCommand(options *GenericOptions) *cobra.Command

func NewStatusCommand

func NewStatusCommand(options *GenericOptions) *cobra.Command

func OutputTaskListAsJSON

func OutputTaskListAsJSON(tasks []connect.Task) ([]byte, error)

func OutputTaskListAsTable

func OutputTaskListAsTable(tasks []connect.Task) ([]byte, error)

func OutputTaskStateAsJSON

func OutputTaskStateAsJSON(taskState *connect.TaskState) ([]byte, error)

func OutputTaskStateAsTable

func OutputTaskStateAsTable(taskState *connect.TaskState) ([]byte, error)

Types

type Client

type Client interface {
	GetConnectorTasks(name string) ([]connect.Task, *http.Response, error)
	GetConnectorTaskStatus(name string, taskID int) (*connect.TaskState, *http.Response, error)
	RestartConnectorTask(name string, taskID int) (*http.Response, error)
}

type ClientFn

type ClientFn func(string) (Client, error)

type GenericOptions

type GenericOptions struct {
	// Function for creating API client
	CreateClient ClientFn

	ClusterURL    string
	ConnectorName string
}

func (*GenericOptions) Validate

func (o *GenericOptions) Validate() error

type GetOptions

type GetOptions struct {
	*GenericOptions

	TaskID int
	Output string
}

func (*GetOptions) Run

func (o *GetOptions) Run(out io.Writer) error

type ListOptions

type ListOptions struct {
	// Use pointer here to make reference to the 'tasks' options.
	// Otherwise, the local copy of the config will be created an no
	// value from the flags will be set. It is caused by the global
	// scope nature of viper and multiple overrides of cluster flag
	// from the other commands.
	*GenericOptions

	Output string
}

func (*ListOptions) Run

func (o *ListOptions) Run(out io.Writer) error

type OutputType

type OutputType string
const (
	OutputTypeJSON  OutputType = "json"
	OutputTypeTable OutputType = "table"
)

type RestartOptions

type RestartOptions struct {
	*GenericOptions

	TaskID int
}

func (*RestartOptions) Run

func (o *RestartOptions) Run() error

type StatusOptions

type StatusOptions struct {
	*GenericOptions

	TaskID int
	Output string
}

func (*StatusOptions) Run

func (o *StatusOptions) Run(out io.Writer) error

type TaskListOutputFn

type TaskListOutputFn func([]connect.Task) ([]byte, error)

type TaskStateOutputFn

type TaskStateOutputFn func(*connect.TaskState) ([]byte, error)

Jump to

Keyboard shortcuts

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