linode

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	InstanceStatus(ctx context.Context) (*Status, error)
	BootInstance(ctx context.Context) error
	ShutdownInstance(ctx context.Context) error
	RebootInstance(ctx context.Context) error
}

func NewHTTP added in v1.1.0

func NewHTTP(opts *Options) Client

type Emitter added in v1.1.0

type Emitter interface {
	event.Emitter[Topic, Status]
}

func NewEmitter added in v1.1.0

func NewEmitter(client Client) (Emitter, error)

type Options

type Options struct {
	InstanceID  string `yaml:"instance_id"`
	AccessToken string `yaml:"access_token"`
}

func Configure added in v1.1.0

func Configure(provider config.Provider) (*Options, error)

type Status added in v1.1.0

type Status int
const (
	StatusRunning           Status = iota // running
	StatusOffline                         // offline
	StatusBooting                         // booting
	StatusRebooting                       // rebooting
	StatusShuttingDown                    // shutting_down
	StatusStopped                         // stopped
	StatusBillingSuspension               // billing_suspension
)

func (Status) String added in v1.1.0

func (i Status) String() string

func (*Status) UnmarshalText added in v1.1.0

func (s *Status) UnmarshalText(data []byte) error

type Topic added in v1.1.0

type Topic int
const (
	TopicStatus Topic = iota
	TopicBoot
	TopicReboot
	TopicShutdown
)

func (Topic) String added in v1.1.0

func (i Topic) String() string

type WorkerOptions added in v1.1.0

type WorkerOptions struct {
	Interval time.Duration `yaml:"interval"`
}

Jump to

Keyboard shortcuts

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