proto

package
v1.0.0-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotDefined     = errors.New("notDefined")
	ErrNotImplemented = errors.New("notImplemented")
	ErrBadRequest     = errors.New("badRequest")
	ErrInProgress     = errors.New("inProgress")
	ErrBusy           = errors.New("busy")
	ErrTimedOut       = errors.New("timedOut")
	ErrFailed         = errors.New("failed")
	ErrInternalError  = errors.New("internalError")
	ErrUnknown        = errors.New("unknown")
)
View Source
var (
	ServiceAction = &Service{
		Kind:    "Action",
		Version: "v1.0",
		URI:     "/v1.0/action",
	}
	ServiceProbe = &Service{
		Kind:    "Probe",
		Version: "v1.0",
		URI:     "/v1.0/probe",
	}
)

Functions

func Error2Type

func Error2Type(err error) string

func Type2Error

func Type2Error(errType string) error

Types

type Action

type Action struct {
	Name           string       `json:"name"`
	Exec           *ExecAction  `json:"exec,omitempty"`
	TimeoutSeconds int32        `json:"timeoutSeconds,omitempty"`
	RetryPolicy    *RetryPolicy `json:"retryPolicy,omitempty"`
}

type ActionRequest

type ActionRequest struct {
	Action         string            `json:"action"`
	Parameters     map[string]string `json:"parameters,omitempty"`
	NonBlocking    *bool             `json:"nonBlocking,omitempty"`
	TimeoutSeconds *int32            `json:"timeoutSeconds,omitempty"`
	RetryPolicy    *RetryPolicy      `json:"retryPolicy,omitempty"`
}

type ActionResponse

type ActionResponse struct {
	Error   string `json:"error,omitempty"`
	Message string `json:"message,omitempty"`
	Output  []byte `json:"output,omitempty"`
}

type ExecAction

type ExecAction struct {
	Commands []string `json:"command,omitempty"`
	Args     []string `json:"args,omitempty"`
}

type Probe

type Probe struct {
	Action              string `json:"action"`
	InitialDelaySeconds int32  `json:"initialDelaySeconds,omitempty"`
	PeriodSeconds       int32  `json:"periodSeconds,omitempty"`
	SuccessThreshold    int32  `json:"successThreshold,omitempty"`
	FailureThreshold    int32  `json:"failureThreshold,omitempty"`
	ReportPeriodSeconds *int32 `json:"reportPeriodSeconds,omitempty"`
}

type ProbeEvent

type ProbeEvent struct {
	Probe   string `json:"probe,omitempty"`
	Code    int32  `json:"code,omitempty"`
	Output  []byte `json:"output,omitempty"`
	Message string `json:"message,omitempty"`
}

type RetryPolicy

type RetryPolicy struct {
	MaxRetries    int           `json:"maxRetries,omitempty"`
	RetryInterval time.Duration `json:"retryInterval,omitempty"`
}

type Service

type Service struct {
	Kind    string
	Version string
	URI     string
}

Jump to

Keyboard shortcuts

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