session

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultQuerySince = 30 * time.Minute

Variables

View Source
var ErrAutoUpdateDisabledButExitCodeSet = errors.New("auto update is disabled but auto update by exit code is set")

Functions

This section is empty.

Types

type Body

type Body struct {
	Data  []byte `json:"data,omitempty"`
	ReqID string `json:"req_id,omitempty"`
}

type Op added in v0.0.5

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

type OpOption added in v0.0.5

type OpOption func(*Op)

func WithAutoUpdateExitCode added in v0.0.5

func WithAutoUpdateExitCode(autoUpdateExitCode int) OpOption

Triggers an auto update of GPUd itself by exiting the process with the given exit code. Useful when the machine is managed by the Kubernetes daemonset and we want to trigger an auto update when the daemonset restarts the machine.

func WithEnableAutoUpdate added in v0.0.5

func WithEnableAutoUpdate(enableAutoUpdate bool) OpOption

func WithMachineID added in v0.0.5

func WithMachineID(machineID string) OpOption

func WithPipeInterval added in v0.0.5

func WithPipeInterval(t time.Duration) OpOption

type Request

type Request struct {
	Method        string        `json:"method,omitempty"`
	Components    []string      `json:"components,omitempty"`
	StartTime     time.Time     `json:"start_time"`
	EndTime       time.Time     `json:"end_time"`
	Since         time.Duration `json:"since"`
	UpdateVersion string        `json:"update_version,omitempty"`
}

type Response

type Response struct {
	Error   error            `json:"error,omitempty"`
	States  v1.LeptonStates  `json:"states,omitempty"`
	Events  v1.LeptonEvents  `json:"events,omitempty"`
	Metrics v1.LeptonMetrics `json:"metrics,omitempty"`
}

type Session

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

func NewSession

func NewSession(ctx context.Context, endpoint string, opts ...OpOption) (*Session, error)

func (*Session) Stop

func (s *Session) Stop()

Jump to

Keyboard shortcuts

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