digitalocean

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RSA_KEY_NAME = "SkyGuard Access Key"
	RSA_KEY_TYPE = "RSA PRIVATE KEY"

	ID_RSA     = "id_rsa"
	ID_RSA_PUB = "id_rsa.pub"
)

Variables

View Source
var ApiKey = os.Getenv("DIGITAL_OCEAN_API_KEY")

Functions

This section is empty.

Types

type DigitalOceanClient

type DigitalOceanClient struct {
	*godo.Client
}

func Connect

func Connect(apiKey string) *DigitalOceanClient

func (*DigitalOceanClient) GetServer

func (client *DigitalOceanClient) GetServer(id string) (*Server, error)

func (*DigitalOceanClient) Launch

func (client *DigitalOceanClient) Launch(s *Server, opts ...hosting.LaunchOption) (*Server, error)

type Server

type Server struct {
	ID     int
	Name   string
	Size   string
	Region string
	Image  string
	Status string
	IP     string
	// contains filtered or unexported fields
}

func (*Server) Alias

func (s *Server) Alias(sub, domain string) (err error)

func (*Server) Connect

func (server *Server) Connect(stdin io.Reader, stdout, _ io.Writer, args ...string) (err error)

func (*Server) Copy

func (server *Server) Copy(path, dst string) (stdout, stderr bytes.Buffer, _ error)

func (*Server) Destroy

func (server *Server) Destroy(ctx context.Context) (err error)

func (*Server) Dump

func (s *Server) Dump(path string, data []byte) (stdout, stderr bytes.Buffer, err error)

func (*Server) Env

func (server *Server) Env(key, value string) error

func (*Server) Exec

func (server *Server) Exec(args ...string) (stdout, stderr bytes.Buffer, err error)

func (*Server) GetID

func (server *Server) GetID() string

func (*Server) GetIP

func (server *Server) GetIP() string

func (*Server) GetName

func (server *Server) GetName() string

func (*Server) Launch

func (server *Server) Launch(opts ...hosting.LaunchOption) (err error)

Jump to

Keyboard shortcuts

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