resources

package
v1.21.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 5 Imported by: 198

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dump

type Dump struct {
	Resources []interface{} `json:"resources,omitempty"`
	Instances []*Instance   `json:"instances,omitempty"`
	Subnets   []*Subnet     `json:"subnets,omitempty"`
	VPC       *VPC          `json:"vpc,omitempty"`
}

Dump is the type for a dump result

func BuildDump

func BuildDump(ctx context.Context, cloud fi.Cloud, resources map[string]*Resource) (*Dump, error)

BuildDump gathers information about the cluster and returns an object for dumping

type DumpOperation

type DumpOperation struct {
	// Context is the golang context.Context for the dump operation
	Context context.Context

	// Cloud is the cloud we are dumping
	Cloud fi.Cloud

	// CloudState allows the cloudprovider to store state during the dump operation
	CloudState interface{}

	// Dump is the target of our dump
	Dump *Dump
}

DumpOperation holds context information for a dump, allowing for extension

type Instance

type Instance struct {
	Name            string   `json:"name,omitempty"`
	PublicAddresses []string `json:"publicAddresses,omitempty"`
	Roles           []string `json:"roles,omitempty"`
	SSHUser         string   `json:"sshUser,omitempty"`
}

Instance is the type for an instance in a dump

type Resource

type Resource struct {
	Name string
	Type string
	ID   string

	// If true, this resource is not owned by the cluster
	Shared bool

	Blocks  []string
	Blocked []string
	Done    bool

	Deleter      func(cloud fi.Cloud, tracker *Resource) error
	GroupKey     string
	GroupDeleter func(cloud fi.Cloud, trackers []*Resource) error

	// Dumper populates the dump with any information from the resource
	Dumper func(op *DumpOperation, r *Resource) error

	Obj interface{}
}

type Subnet

type Subnet struct {
	ID   string `json:"id,omitempty"`
	Zone string `json:"zone,omitempty"`
}

Subnet is the type for an subnetwork in a dump

type VPC

type VPC struct {
	ID string `json:"id,omitempty"`
}

VPC is the type for an VPC in a dump

Directories

Path Synopsis
dns

Jump to

Keyboard shortcuts

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