cli

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiActionJobStart   = "start"
	ApiActionJobRestart = "restart"
	ApiActionJobStop    = "stop"
	ApiActionJobStatus  = "status"
	ApiActionJobLogs    = "logs"
)

Variables

This section is empty.

Functions

func NewTypedAPIResponse added in v1.9.0

func NewTypedAPIResponse[TBody any](body TBody) func(resp *http.Response, err error) *TypedAPIResponse[TBody]

Types

type APIClient added in v1.9.0

type APIClient struct {
	// contains filtered or unexported fields
}

func NewApiClient

func NewApiClient(apiAddress string) *APIClient

func (*APIClient) CallAction added in v1.9.0

func (api *APIClient) CallAction(job, action string) APIResponse

func (*APIClient) JobList added in v1.9.0

func (api *APIClient) JobList() TypedAPIResponse[[]string]

func (*APIClient) JobLogs added in v1.9.0

func (api *APIClient) JobLogs(job string, follow bool, tailLen int) APIResponse

func (*APIClient) JobRestart added in v1.9.0

func (api *APIClient) JobRestart(job string) APIResponse

func (*APIClient) JobStart added in v1.9.0

func (api *APIClient) JobStart(job string) APIResponse

func (*APIClient) JobStatus added in v1.9.0

func (api *APIClient) JobStatus(job string) TypedAPIResponse[proc.CommonJobStatus]

func (*APIClient) JobStop added in v1.9.0

func (api *APIClient) JobStop(job string) APIResponse

type APIResponse added in v1.9.0

type APIResponse interface {
	Print() error
	Err() error
}

func NewAPIResponse added in v1.9.0

func NewAPIResponse(resp *http.Response, err error) APIResponse

func NewStreamingAPIResponse added in v1.9.0

func NewStreamingAPIResponse(url *url.URL, dialer *websocket.Dialer, streamingFunc StreamingAPIResponseHandler) APIResponse

type CommonAPIResponse added in v1.9.0

type CommonAPIResponse struct {
	StatusCode int    `json:"statusCode"`
	Body       string `json:"body"`
	Error      error  `json:"error"`
	// contains filtered or unexported fields
}

func (*CommonAPIResponse) Err added in v1.9.0

func (resp *CommonAPIResponse) Err() error

func (*CommonAPIResponse) Print added in v1.9.0

func (resp *CommonAPIResponse) Print() error

type StreamingAPIResponse added in v1.9.0

type StreamingAPIResponse struct {
	// contains filtered or unexported fields
}

func (*StreamingAPIResponse) Err added in v1.9.0

func (resp *StreamingAPIResponse) Err() error

func (*StreamingAPIResponse) Print added in v1.9.0

func (resp *StreamingAPIResponse) Print() error

type StreamingAPIResponseHandler added in v1.9.0

type StreamingAPIResponseHandler func(ctx context.Context, conn *websocket.Conn, msg chan []byte, err chan error)

type TypedAPIResponse added in v1.9.0

type TypedAPIResponse[TBody any] struct {
	StatusCode int   `json:"statusCode"`
	Body       TBody `json:"body"`
	Error      error `json:"error"`
	// contains filtered or unexported fields
}

func (*TypedAPIResponse[TBody]) Err added in v1.9.0

func (resp *TypedAPIResponse[TBody]) Err() error

func (*TypedAPIResponse[TBody]) Print added in v1.9.0

func (resp *TypedAPIResponse[TBody]) Print() error

Jump to

Keyboard shortcuts

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