ops: github.com/nanovms/ops/lepton Index | Files

package lepton

import "github.com/nanovms/ops/lepton"

Index

Package Files

aws.go config.go const.go digital_ocean.go download.go gcp.go gcpstore.go helpers.go homedir.go hv_support_linux.go hypervisor.go image.go instance.go ldd_linux.go manifest.go objects.go onprem.go package.go provider.go qemu.go role.go s3.go spaces.go update.go vultr.go

Constants

const (
    // WarningColor used in warning texts
    WarningColor = "\033[1;33m%s\033[0m"
    // ErrorColor used in error texts
    ErrorColor = "\033[1;31m%s\033[0m"
)
const (
    Day      = 24 * time.Hour
    Week     = 7 * Day
    Month    = 30 * Day
    Year     = 12 * Month
    LongTime = 37 * Year
)

Seconds-based time units

const (
    Byte = 1 << (iota * 10)
    KiByte
    MiByte
    GiByte
    TiByte
    PiByte
    EiByte
)

IEC Sizes. kibis of bits

const (
    IByte = 1
    KByte = IByte * 1000
    MByte = KByte * 1000
    GByte = MByte * 1000
    TByte = GByte * 1000
    PByte = TByte * 1000
    EByte = PByte * 1000
)

SI Sizes.

const GCPStorageURL string = "https://storage.googleapis.com/%v/%v"

GCPStorageURL is GCP storage path

const OpsReleaseURL = "https://storage.googleapis.com/cli/%v/ops"

OpsReleaseURL gives URL to download latest ops binary

const PackageBaseURL string = "https://storage.googleapis.com/packagehub/%v"

PackageBaseURL gives URL for downloading of packages

const PackageManifestFileName string = "manifest.json"

PackageManifestFileName is manifest file path

const PackageManifestURL string = "https://storage.googleapis.com/packagehub/manifest.json"

PackageManifestURL stores info about all packages

const Version = "0.1.10"

Version for ops

Variables

var LatestReleaseVersion = getLatestRelVersion()

LatestReleaseVersion give latest stable release for nanos

var LocalReleaseVersion = getLocalRelVersion()

LocalReleaseVersion is version latest release downloaded in ops home

var NightlyLocalFolder = nightlyLocalFolder()

NightlyLocalFolder is directory path where nightly builds are stored

var NightlyReleaseURL = nightlyReleaseURL()

NightlyReleaseURL give URL for nightly build

var PackagesCache = getPackageCache()

PackagesCache where all packages are stored

func Apply Uses

func Apply(update io.Reader, opts Options) error

Apply performs an update of the current executable (or opts.TargetFile, if set) with the contents of the given io.Reader.

Apply performs the following actions to ensure a safe cross-platform update:

1. If configured, applies the contents of the update io.Reader as a binary patch.

2. If configured, computes the checksum of the new executable and verifies it matches.

3. If configured, verifies the signature with a public key.

4. Creates a new file, /path/to/.target.new with the TargetMode with the contents of the updated file

5. Renames /path/to/target to /path/to/.target.old

6. Renames /path/to/.target.new to /path/to/target

7. If the final rename is successful, deletes /path/to/.target.old, returns no error. On Windows, the removal of /path/to/target.old always fails, so instead Apply hides the old file instead.

8. If the final rename fails, attempts to roll back by renaming /path/to/.target.old back to /path/to/target.

func BuildImage Uses

func BuildImage(c Config) error

BuildImage builds a unikernel image for user supplied ELF binary.

func BuildImageFromPackage Uses

func BuildImageFromPackage(packagepath string, c Config) error

BuildImageFromPackage builds nanos image using a package

func CustomRelTime Uses

func CustomRelTime(a, b time.Time, albl, blbl string, magnitudes []RelTimeMagnitude) string

CustomRelTime formats a time into a relative string.

It takes two times two labels and a table of relative time formats. In addition to the generic time delta string (e.g. 5 minutes), the labels are used applied so that the label corresponding to the smaller time is applied.

func DoUpdate Uses

func DoUpdate(url string) error

DoUpdate updates file using provided URL

func DownloadFile Uses

func DownloadFile(filepath string, url string, timeout int) error

DownloadFile downloads file using URL

func DownloadNightlyImages Uses

func DownloadNightlyImages(c *Config) error

DownloadNightlyImages downloads nightly build for nanos

func DownloadPackage Uses

func DownloadPackage(name string) (string, error)

DownloadPackage downloads package by name

func DownloadReleaseImages Uses

func DownloadReleaseImages(version string) error

DownloadReleaseImages downloads nanos for particular release version

func Expand Uses

func Expand(path string) (string, error)

Expand expands the path to include the home directory if the path is prefixed with `~`. If it isn't prefixed with `~`, the path is returned as-is.

func ExtractPackage Uses

func ExtractPackage(archive string, dest string)

ExtractPackage extracts package in ops home. This function is currently over-loaded.

func GenerateImageName Uses

func GenerateImageName(program string) string

GenerateImageName generate image name

func GetOpsHome Uses

func GetOpsHome() string

GetOpsHome get ops directory path We store all ops related info, packages, images in this directory

func GetPackageList Uses

func GetPackageList() *map[string]Package

GetPackageList provides list of packages

func GetPackageManifestFile Uses

func GetPackageManifestFile() string

GetPackageManifestFile give path for package manifest file

func HomeDir Uses

func HomeDir() (string, error)

HomeDir from https://github.com/mitchellh/go-homedir Dir returns the home directory for the executing user. This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.

func LocalTimeStamp Uses

func LocalTimeStamp() (string, error)

LocalTimeStamp gives local timestamp from download nightly build

func PackageManifestChanged Uses

func PackageManifestChanged(fino os.FileInfo, remoteURL string) bool

PackageManifestChanged verifies if package manifest changed

func QemuVersion Uses

func QemuVersion() (string, error)

QemuVersion gives the version of qemu running locally.

func RelTime Uses

func RelTime(a, b time.Time, albl, blbl string) string

RelTime formats a time into a relative string.

It takes two times and two labels. In addition to the generic time delta string (e.g. 5 minutes), the labels are used applied so that the label corresponding to the smaller time is applied.

RelTime(timeInPast, timeInFuture, "earlier", "later") -> "3 weeks earlier"

func RemoteTimeStamp Uses

func RemoteTimeStamp() (string, error)

RemoteTimeStamp gives latest nightly build timestamp

func RollbackError Uses

func RollbackError(err error) error

RollbackError takes an error value returned by Apply and returns the error, if any, that occurred when attempting to roll back from a failed update. Applications should always call this function on any non-nil errors returned by Apply.

If no rollback was needed or if the rollback was successful, RollbackError returns nil, otherwise it returns the error encountered when trying to roll back.

func VerifyRole Uses

func VerifyRole(ctx *Context, bucket string)

VerifyRole ensures we have a role and attached policy for the vmie service to hit our bucket.

type AWS Uses

type AWS struct {
    Storage *S3
}

AWS contains all operations for AWS

func (*AWS) BuildImage Uses

func (p *AWS) BuildImage(ctx *Context) (string, error)

BuildImage to be upload on AWS

func (*AWS) BuildImageWithPackage Uses

func (p *AWS) BuildImageWithPackage(ctx *Context, pkgpath string) (string, error)

BuildImageWithPackage to upload on AWS

func (*AWS) CreateImage Uses

func (p *AWS) CreateImage(ctx *Context) error

CreateImage - Creates image on AWS using nanos images TODO : re-use and cache DefaultClient and instances.

func (*AWS) CreateInstance Uses

func (p *AWS) CreateInstance(ctx *Context) error

CreateInstance - Creates instance on AWS Platform

func (*AWS) CreateSG Uses

func (p *AWS) CreateSG(ctx *Context, svc *ec2.EC2, imgName string) (string, error)

CreateSG - Create security group for now just use default vpc

func (*AWS) DeleteImage Uses

func (p *AWS) DeleteImage(ctx *Context, imagename string) error

DeleteImage deletes image from AWS by ami name

func (*AWS) DeleteInstance Uses

func (p *AWS) DeleteInstance(ctx *Context, instancename string) error

DeleteInstance deletes instnace from AWS

func (*AWS) GetInstanceLogs Uses

func (p *AWS) GetInstanceLogs(ctx *Context, instancename string, watch bool) error

GetInstanceLogs gets instance related logs

func (*AWS) Initialize Uses

func (p *AWS) Initialize() error

Initialize AWS related things

func (*AWS) ListImages Uses

func (p *AWS) ListImages(ctx *Context) error

ListImages lists images on AWS

func (*AWS) ListInstances Uses

func (p *AWS) ListInstances(ctx *Context) error

ListInstances lists instances on AWS

func (*AWS) ResizeImage Uses

func (p *AWS) ResizeImage(ctx *Context, imagename string, hbytes string) error

ResizeImage is not supported on AWS.

func (*AWS) StartInstance Uses

func (p *AWS) StartInstance(ctx *Context, imagename string) error

StartInstance stops instance from AWS by ami name

func (*AWS) StopInstance Uses

func (p *AWS) StopInstance(ctx *Context, imagename string) error

StopInstance stops instance from AWS by ami name

type Config Uses

type Config struct {
    Args         []string
    BuildDir     string
    Dirs         []string
    Files        []string
    MapDirs      map[string]string
    Env          map[string]string
    Debugflags   []string
    NoTrace      []string
    Program      string
    Version      string
    Boot         string
    Kernel       string
    Mkfs         string
    NameServer   string
    NightlyBuild bool
    RunConfig    RunConfig
    CloudConfig  ProviderConfig
    Force        bool
    TargetRoot   string
    BaseVolumeSz string // optional base volume sz
    ManifestName string // save manifest to
    RebootOnExit bool   // Reboot on Failure Exit
}

Config for Build

type Context Uses

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

Context captures required info for provider operation

func NewContext Uses

func NewContext(c *Config, provider *Provider) *Context

NewContext Create a new context for the given provider valid providers are "gcp", "aws" and "onprem"

type DigitalOcean Uses

type DigitalOcean struct {
    Storage *Spaces
}

DigitalOcean provides access to the DigitalOcean API.

func (*DigitalOcean) BuildImage Uses

func (do *DigitalOcean) BuildImage(ctx *Context) (string, error)

BuildImage to be upload on DO

func (*DigitalOcean) BuildImageWithPackage Uses

func (do *DigitalOcean) BuildImageWithPackage(ctx *Context, pkgpath string) (string, error)

BuildImageWithPackage to upload on DO .

func (*DigitalOcean) CreateImage Uses

func (do *DigitalOcean) CreateImage(ctx *Context) error

CreateImage - Creates image on DO using nanos images

This is currently blocked on DO allowing us to give it signed urls for image imports. If you wish to manage with digital ocean you need to manually upload the image for now.

https://github.com/nanovms/ops/issues/468

func (*DigitalOcean) CreateInstance Uses

func (do *DigitalOcean) CreateInstance(ctx *Context) error

CreateInstance - Creates instance on Digital Ocean Platform

func (*DigitalOcean) DeleteImage Uses

func (do *DigitalOcean) DeleteImage(ctx *Context, imagename string) error

DeleteImage deletes image from DO

func (*DigitalOcean) DeleteInstance Uses

func (do *DigitalOcean) DeleteInstance(ctx *Context, instancename string) error

DeleteInstance deletes instance from DO

func (*DigitalOcean) GetInstanceLogs Uses

func (do *DigitalOcean) GetInstanceLogs(ctx *Context, instancename string, watch bool) error

GetInstanceLogs gets instance related logs

func (*DigitalOcean) Initialize Uses

func (do *DigitalOcean) Initialize() error

Initialize GCP related things

func (*DigitalOcean) ListImages Uses

func (do *DigitalOcean) ListImages(ctx *Context) error

ListImages lists images on Digital Ocean

func (*DigitalOcean) ListInstances Uses

func (do *DigitalOcean) ListInstances(ctx *Context) error

ListInstances lists instances on DO

func (*DigitalOcean) ResizeImage Uses

func (do *DigitalOcean) ResizeImage(ctx *Context, imagename string, hbytes string) error

ResizeImage is not supported on Digital Ocean.

func (*DigitalOcean) StartInstance Uses

func (do *DigitalOcean) StartInstance(ctx *Context, instancename string) error

StartInstance starts an instance in DO

func (*DigitalOcean) StopInstance Uses

func (do *DigitalOcean) StopInstance(ctx *Context, instancename string) error

StopInstance deletes instance from DO

type GCPStorage Uses

type GCPStorage struct{}

GCPStorage provides GCP storage related operations

func (*GCPStorage) CopyToBucket Uses

func (s *GCPStorage) CopyToBucket(config *Config, archPath string) error

CopyToBucket copies archive to bucket

type GCloud Uses

type GCloud struct {
    Storage *GCPStorage
}

GCloud contains all operations for GCP

func (*GCloud) BuildImage Uses

func (p *GCloud) BuildImage(ctx *Context) (string, error)

BuildImage to be upload on GCP

func (*GCloud) BuildImageWithPackage Uses

func (p *GCloud) BuildImageWithPackage(ctx *Context, pkgpath string) (string, error)

BuildImageWithPackage to upload on GCP

func (*GCloud) CreateImage Uses

func (p *GCloud) CreateImage(ctx *Context) error

CreateImage - Creates image on GCP using nanos images TODO : re-use and cache DefaultClient and instances.

func (*GCloud) CreateInstance Uses

func (p *GCloud) CreateInstance(ctx *Context) error

CreateInstance - Creates instance on Google Cloud Platform

func (*GCloud) DeleteImage Uses

func (p *GCloud) DeleteImage(ctx *Context, imagename string) error

DeleteImage deletes image from Gcloud

func (*GCloud) DeleteInstance Uses

func (p *GCloud) DeleteInstance(ctx *Context, instancename string) error

DeleteInstance deletes instance from Gcloud

func (*GCloud) GetInstanceLogs Uses

func (p *GCloud) GetInstanceLogs(ctx *Context, instancename string, watch bool) error

GetInstanceLogs gets instance related logs

func (*GCloud) Initialize Uses

func (p *GCloud) Initialize() error

Initialize GCP related things

func (*GCloud) ListImages Uses

func (p *GCloud) ListImages(ctx *Context) error

ListImages lists images on Google Cloud

func (*GCloud) ListInstances Uses

func (p *GCloud) ListInstances(ctx *Context) error

ListInstances lists instances on Gcloud

func (*GCloud) ResizeImage Uses

func (p *GCloud) ResizeImage(ctx *Context, imagename string, hbytes string) error

ResizeImage is not supported on google cloud.

func (*GCloud) StartInstance Uses

func (p *GCloud) StartInstance(ctx *Context, instancename string) error

StartInstance starts an instance in GCloud

func (*GCloud) StopInstance Uses

func (p *GCloud) StopInstance(ctx *Context, instancename string) error

StopInstance deletes instance from GCloud

type GCloudOperation Uses

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

GCloudOperation status check

type Hypervisor Uses

type Hypervisor interface {
    Start(rconfig *RunConfig) error
    Command(rconfig *RunConfig) *exec.Cmd
    Stop()
}

Hypervisor interface

func HypervisorInstance Uses

func HypervisorInstance() Hypervisor

HypervisorInstance provides available hypervisor

type Manifest Uses

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

Manifest represent the filesystem.

func BuildManifest Uses

func BuildManifest(c *Config) (*Manifest, error)

BuildManifest builds manifest using config

func BuildPackageManifest Uses

func BuildPackageManifest(packagepath string, c *Config) (*Manifest, error)

BuildPackageManifest builds manifest using package

func NewManifest Uses

func NewManifest(targetRoot string) *Manifest

NewManifest init

func (*Manifest) AddArgument Uses

func (m *Manifest) AddArgument(arg string)

AddArgument add commandline arguments to user program

func (*Manifest) AddDebugFlag Uses

func (m *Manifest) AddDebugFlag(name string, value rune)

AddDebugFlag enables debug flags

func (*Manifest) AddDirectory Uses

func (m *Manifest) AddDirectory(dir string) error

AddDirectory adds all files in dir to image

func (*Manifest) AddEnvironmentVariable Uses

func (m *Manifest) AddEnvironmentVariable(name string, value string)

AddEnvironmentVariable adds environment variables

func (*Manifest) AddFile Uses

func (m *Manifest) AddFile(filepath string, hostpath string) error

AddFile to add a file to manifest

func (*Manifest) AddKernel Uses

func (m *Manifest) AddKernel(path string)

AddKernel the kernel to use

func (*Manifest) AddLibrary Uses

func (m *Manifest) AddLibrary(path string)

AddLibrary to add a dependent library

func (m *Manifest) AddLink(filepath string, hostpath string) error

AddLink to add a file to manifest

func (*Manifest) AddNoTrace Uses

func (m *Manifest) AddNoTrace(name string)

AddNoTrace enables debug flags

func (*Manifest) AddRelative Uses

func (m *Manifest) AddRelative(key string, path string)

AddRelative path

func (*Manifest) AddUserData Uses

func (m *Manifest) AddUserData(dir string)

AddUserData adds all files in dir to final image.

func (*Manifest) AddUserProgram Uses

func (m *Manifest) AddUserProgram(imgpath string)

AddUserProgram adds user program

func (*Manifest) FileExists Uses

func (m *Manifest) FileExists(filepath string) bool

FileExists checks if file is present at path in manifest

func (*Manifest) String Uses

func (m *Manifest) String() string

type Objects Uses

type Objects struct{}

Objects provides Vultr Object Storage related operations

func (*Objects) CopyToBucket Uses

func (s *Objects) CopyToBucket(config *Config, archPath string) error

CopyToBucket copies archive to bucket

func (*Objects) DeleteFromBucket Uses

func (s *Objects) DeleteFromBucket(config *Config, key string) error

DeleteFromBucket deletes key from config's bucket

type OnPrem Uses

type OnPrem struct{}

OnPrem provider for ops

func (*OnPrem) BuildImage Uses

func (p *OnPrem) BuildImage(ctx *Context) (string, error)

BuildImage for onprem

func (*OnPrem) BuildImageWithPackage Uses

func (p *OnPrem) BuildImageWithPackage(ctx *Context, pkgpath string) (string, error)

BuildImageWithPackage for onprem

func (*OnPrem) CreateImage Uses

func (p *OnPrem) CreateImage(ctx *Context) error

CreateImage on prem assumes local for now

func (*OnPrem) CreateInstance Uses

func (p *OnPrem) CreateInstance(ctx *Context) error

CreateInstance on premise assumes local

func (*OnPrem) DeleteImage Uses

func (p *OnPrem) DeleteImage(ctx *Context, imagename string) error

DeleteImage on premise

func (*OnPrem) DeleteInstance Uses

func (p *OnPrem) DeleteInstance(ctx *Context, instancename string) error

DeleteInstance from on premise

func (*OnPrem) GetInstanceLogs Uses

func (p *OnPrem) GetInstanceLogs(ctx *Context, instancename string, watch bool) error

GetInstanceLogs for onprem instance logs

func (*OnPrem) Initialize Uses

func (p *OnPrem) Initialize() error

Initialize on prem provider

func (*OnPrem) ListImages Uses

func (p *OnPrem) ListImages(ctx *Context) error

ListImages on premise

func (*OnPrem) ListInstances Uses

func (p *OnPrem) ListInstances(ctx *Context) error

ListInstances on premise

func (*OnPrem) ResizeImage Uses

func (p *OnPrem) ResizeImage(ctx *Context, imagename string, hbytes string) error

ResizeImage resizes the lcoal image imagename. You should never specify a negative size.

func (*OnPrem) StartInstance Uses

func (p *OnPrem) StartInstance(ctx *Context, instancename string) error

StartInstance from on premise

func (*OnPrem) StopInstance Uses

func (p *OnPrem) StopInstance(ctx *Context, instancename string) error

StopInstance from on premise

type Options Uses

type Options struct {
    // TargetPath defines the path to the file to update.
    // The emptry string means 'the executable file of the running program'.
    TargetPath string

    // Create TargetPath replacement with this file mode. If zero, defaults to 0755.
    TargetMode os.FileMode

    // Checksum of the new binary to verify against. If nil, no checksum or signature verification is done.
    Checksum []byte

    // Public key to use for signature verification. If nil, no signature verification is done.
    PublicKey crypto.PublicKey

    // Signature to verify the updated file. If nil, no signature verification is done.
    Signature []byte

    // Use this hash function to generate the checksum. If not set, SHA256 is used.
    Hash crypto.Hash

    // Store the old executable file at this path after a successful update.
    // The empty string means the old executable file will be removed after the update.
    OldSavePath string
}

Options for binary update

func (*Options) CheckPermissions Uses

func (o *Options) CheckPermissions() error

CheckPermissions determines whether the process has the correct permissions to perform the requested update. If the update can proceed, it returns nil, otherwise it returns the error that would occur if an update were attempted.

func (*Options) SetPublicKeyPEM Uses

func (o *Options) SetPublicKeyPEM(pembytes []byte) error

SetPublicKeyPEM is a convenience method to set the PublicKey property used for checking a completed update's signature by parsing a Public Key formatted as PEM data.

type Package Uses

type Package struct {
    Runtime     string `json:"runtime"`
    Version     string `json:"version"`
    Language    string `json:"language"`
    Description string `json:"description,omitempty"`
    SHA256      string `json:"sha256"`
}

Package is the definition of an OPS package.

type PackageList Uses

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

PackageList contains a list of known packages.

type Provider Uses

type Provider interface {
    Initialize() error
    BuildImage(ctx *Context) (string, error)
    BuildImageWithPackage(ctx *Context, pkgpath string) (string, error)
    CreateImage(ctx *Context) error
    ListImages(ctx *Context) error
    DeleteImage(ctx *Context, imagename string) error
    ResizeImage(ctx *Context, imagename string, hbytes string) error
    CreateInstance(ctx *Context) error
    ListInstances(ctx *Context) error
    DeleteInstance(ctx *Context, instancename string) error
    StopInstance(ctx *Context, instancename string) error
    StartInstance(ctx *Context, instancename string) error
    GetInstanceLogs(ctx *Context, instancename string, watch bool) error
}

Provider is an interface that provider must implement

type ProviderConfig Uses

type ProviderConfig struct {
    Platform   string `cloud:"platfom"`
    ProjectID  string `cloud:"projectid"`
    Zone       string `cloud:"zone"`
    BucketName string `cloud:"bucketname"`
    ImageName  string `cloud:"imagename"`
    Flavor     string `cloud:"flavor"`
}

ProviderConfig give provider details

type RelTimeMagnitude Uses

type RelTimeMagnitude struct {
    D      time.Duration
    Format string
    DivBy  time.Duration
}

A RelTimeMagnitude struct contains a relative time point at which the relative format of time will switch to a new format string. A slice of these in ascending order by their "D" field is passed to CustomRelTime to format durations.

The Format field is a string that may contain a "%s" which will be replaced with the appropriate signed label (e.g. "ago" or "from now") and a "%d" that will be replaced by the quantity.

The DivBy field is the amount of time the time difference must be divided by in order to display correctly.

e.g. if D is 2*time.Minute and you want to display "%d minutes %s" DivBy should be time.Minute so whatever the duration is will be expressed in minutes.

type ResourceWrapper Uses

type ResourceWrapper struct {
    Everything bool
    List       []string
}

ResourceWrapper wraps the resource block as it can be 2 types, an array of strings or wildcard.

func (ResourceWrapper) MarshalJSON Uses

func (w ResourceWrapper) MarshalJSON() ([]byte, error)

MarshalJSON is a custom unmarshaller to support multiple types for Resource.

func (*ResourceWrapper) UnmarshalJSON Uses

func (w *ResourceWrapper) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON is a custom unmarshaller to support multiple types for Resource.

type RolePolicy Uses

type RolePolicy struct {
    Version   string
    Statement []RoleStatement
}

RolePolicy is the representation of an aws role policy.

type RoleStatement Uses

type RoleStatement struct {
    Effect   string
    Action   []string
    Resource ResourceWrapper
}

RoleStatement is the representation of a statement of a RolePolicy.

type RunConfig Uses

type RunConfig struct {
    Imagename string // FIXME: fullpath? of image
    BaseName  string // FIXME: basename of image only
    Ports     []int
    GdbPort   int
    Verbose   bool
    Memory    string
    Bridged   bool
    TapName   string
    Accel     bool
    OnPrem    bool // true if in a multi-instance/tenant on-prem env
}

RunConfig provides runtime details

func RuntimeConfig Uses

func RuntimeConfig(image string, ports []int, verbose bool) RunConfig

RuntimeConfig constructs runtime config

type S3 Uses

type S3 struct{}

S3 provides AWS storage related operations

func (*S3) CopyToBucket Uses

func (s *S3) CopyToBucket(config *Config, archPath string) error

CopyToBucket copies archive to bucket

func (*S3) DeleteFromBucket Uses

func (s *S3) DeleteFromBucket(config *Config, key string) error

DeleteFromBucket deletes key from config's bucket

type Spaces Uses

type Spaces struct{}

Spaces provides Digital Ocean storage related operations

func (*Spaces) CopyToBucket Uses

func (s *Spaces) CopyToBucket(config *Config, archPath string) error

CopyToBucket copies archive to bucket

func (*Spaces) DeleteFromBucket Uses

func (s *Spaces) DeleteFromBucket(config *Config, key string) error

DeleteFromBucket deletes key from config's bucket

type Vultr Uses

type Vultr struct {
    Storage *Objects
}

Vultr provides access to the Vultr API.

func (*Vultr) BuildImage Uses

func (v *Vultr) BuildImage(ctx *Context) (string, error)

BuildImage to be upload on v

func (*Vultr) BuildImageWithPackage Uses

func (v *Vultr) BuildImageWithPackage(ctx *Context, pkgpath string) (string, error)

BuildImageWithPackage to upload on Vultr.

func (*Vultr) CreateImage Uses

func (v *Vultr) CreateImage(ctx *Context) error

CreateImage - Creates image on v using nanos images

func (*Vultr) CreateInstance Uses

func (v *Vultr) CreateInstance(ctx *Context) error

CreateInstance - Creates instance on Digital Ocean Platform

func (*Vultr) DeleteImage Uses

func (v *Vultr) DeleteImage(ctx *Context, snapshotID string) error

DeleteImage deletes image from v

func (*Vultr) DeleteInstance Uses

func (v *Vultr) DeleteInstance(ctx *Context, instanceID string) error

DeleteInstance deletes instance from v

func (*Vultr) GetInstanceLogs Uses

func (v *Vultr) GetInstanceLogs(ctx *Context, instancename string, watch bool) error

GetInstanceLogs gets instance related logs

func (*Vultr) Initialize Uses

func (v *Vultr) Initialize() error

Initialize GCP related things

func (*Vultr) ListImages Uses

func (v *Vultr) ListImages(ctx *Context) error

ListImages lists images on Digital Ocean

func (*Vultr) ListInstances Uses

func (v *Vultr) ListInstances(ctx *Context) error

ListInstances lists instances on v

func (*Vultr) ResizeImage Uses

func (v *Vultr) ResizeImage(ctx *Context, imagename string, hbytes string) error

ResizeImage is not supported on Vultr.

func (*Vultr) StartInstance Uses

func (v *Vultr) StartInstance(ctx *Context, instanceID string) error

StartInstance starts an instance in v

func (*Vultr) StopInstance Uses

func (v *Vultr) StopInstance(ctx *Context, instanceID string) error

StopInstance halts instance from v

type WriteCounter Uses

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

WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func NewWriteCounter Uses

func NewWriteCounter(total int) *WriteCounter

NewWriteCounter creates new write counter

func (*WriteCounter) Finish Uses

func (wc *WriteCounter) Finish()

Finish progress bar

func (*WriteCounter) Start Uses

func (wc *WriteCounter) Start()

Start progress bar

func (*WriteCounter) Write Uses

func (wc *WriteCounter) Write(p []byte) (int, error)

Package lepton imports 52 packages (graph) and is imported by 1 packages. Updated 2020-06-07. Refresh now. Tools for package owners.