schema

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	DBInstanceId  string `table:"ID"`
	Engine        string `table:"Engine"`
	EngineVersion string `table:"Version"`
	Region        string `table:"Region"`
}

type ErrNoSuchKey

type ErrNoSuchKey struct {
	Name string
}

ErrNoSuchKey means no such key exists in metadata.

func (*ErrNoSuchKey) Error

func (e *ErrNoSuchKey) Error() string

Error returns the value of the metadata key

type Host

type Host struct {
	PublicIPv4  string `table:"Public IP"`
	PrivateIpv4 string `table:"Private IP"`
	DNSName     string `table:"DNS Name"`
	Public      bool   `table:"Public"`
	Region      string `table:"Region"`
}

type OptionBlock

type OptionBlock map[string]string

OptionBlock is a single option on which operation is possible

func (OptionBlock) GetMetadata

func (o OptionBlock) GetMetadata(key string) (string, bool)

GetMetadata returns the value for a key if it exists.

type Options

type Options []OptionBlock

Options contains configuration options for a provider

type Provider

type Provider interface {
	// Name returns the name of the provider
	Name() string
	// Resources returns the provider for an resource deployment source.
	Resources(ctx context.Context) (*Resources, error)
	UserManagement(action, uname, pwd string)
}

Provider is an interface implemented by any cloud service provider.

It provides the bare minimum of methods to allow complete overview of user data.

type Resources

type Resources struct {
	Provider  string
	Hosts     []*Host
	Storages  []*Storage
	Users     []*User
	Databases []*Database
}

func NewResources

func NewResources() *Resources

NewResources creates a new resources structure

type Storage

type Storage struct {
	BucketName  string `table:"Bucket"`
	AccountName string `table:"Storage Account"`
	Region      string `table:"Region"`
}

type User

type User struct {
	UserName    string `table:"User"`
	UserId      string `table:"ID"`
	EnableLogin bool   `table:"Enable Login"`
	LastLogin   string `table:"Last Login"`
	CreateTime  string `table:"Creat Time"`
}

Jump to

Keyboard shortcuts

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