cumulus

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DescriptionMeta = FieldMeta{
		Kind:          DESCRIPTION,
		Name:          "description",
		DefaultHidden: true,
	}

	NameMeta = FieldMeta{
		Kind: NAME,
		Name: "name",
	}

	IDMeta = FieldMeta{
		Kind: GID,
		Name: "ID",
	}
)
View Source
var DefaultHidden = func(meta FieldMeta) FieldMeta {
	meta.DefaultHidden = true
	return meta
}

Functions

func HandleError

func HandleError(ctx context.Context, err error)

func IgnoreErrors

func IgnoreErrors(ctx context.Context, err error)

IgnoreErrors ignores all errors. If it returns true, procesing should be aborted

func LogErrors

func LogErrors(ctx context.Context, err error)

func WithErrorHandler

func WithErrorHandler(ctx context.Context, handler ErrorHandler) context.Context

Types

type Account

type Account interface {
	fmt.Stringer
	InRegion(region string) RegionalAccount
	Name() string
	Fielder
	AccountInfoer
}

type AccountInfo

type AccountInfo interface {
	Common
	Account() Account
	Ctx() context.Context
	Name() string
	ID() string
}

AccountInfo gets details about a specific account

type AccountInfoer

type AccountInfoer interface {
	AccountInfos(context.Context) chan AccountInfo
}

AccountInfoer marks a type that can provide a channel of AccountInfo

type Accounts

type Accounts []Account

func (Accounts) AccountInfos

func (a Accounts) AccountInfos(ctx context.Context) chan AccountInfo

func (Accounts) InRegion

func (a Accounts) InRegion(region ...string) RegionalAccounts

func (Accounts) NameRecords

func (a Accounts) NameRecords(ctx context.Context) chan NameRecord

func (Accounts) String

func (a Accounts) String() string

func (Accounts) Unique

func (a Accounts) Unique(ctx context.Context) Accounts

func (Accounts) Zones

func (a Accounts) Zones(ctx context.Context) chan Zone

type Common

type Common interface {
	Fielder
	Sourcer
	Ctx() context.Context
}

type DBCluster added in v0.5.0

type DBCluster interface {
	Common
}

type DBClusterer added in v0.5.0

type DBClusterer interface {
	DBClusters(context.Context) chan DBCluster
}

DBClusterer marks a type that can provide a channel of DBCluster

type DBInstance added in v0.5.0

type DBInstance interface {
	Common
}

type DBInstancer added in v0.5.0

type DBInstancer interface {
	DBInstances(context.Context) chan DBInstance
}

DBInstancer marks a type that can provide a channel of DBInstance

type ErrorCollector

type ErrorCollector struct {
	Error error
}

ErrorCollector uses multierror to accumulate errors into a large list

func (*ErrorCollector) Handle

func (e *ErrorCollector) Handle(ctx context.Context, err error)

type ErrorHandler

type ErrorHandler func(ctx context.Context, err error)

ErrorHandler is called by individual methods to handle and possibly abort processing

func ErrorContext

func ErrorContext(ctx context.Context) ErrorHandler

type FieldBuilder

type FieldBuilder struct {
	Fields Fields
}

func NewBuilder

func NewBuilder() *FieldBuilder

func (*FieldBuilder) Add

func (f *FieldBuilder) Add(meta FieldMeta, value string, options ...MetadataOption) *FieldBuilder

func (*FieldBuilder) Description

func (f *FieldBuilder) Description(value string) *FieldBuilder

func (*FieldBuilder) Done

func (f *FieldBuilder) Done()

Done is syntactic sugar to help make a chain of calls more convenient

func (*FieldBuilder) GID

func (f *FieldBuilder) GID(value string) *FieldBuilder

func (*FieldBuilder) How

func (f *FieldBuilder) How(name, value string, options ...MetadataOption) *FieldBuilder

func (*FieldBuilder) Name

func (f *FieldBuilder) Name(value string) *FieldBuilder

func (*FieldBuilder) Tag

func (f *FieldBuilder) Tag(name, value string, options ...MetadataOption) *FieldBuilder

func (*FieldBuilder) What

func (f *FieldBuilder) What(name, value string, options ...MetadataOption) *FieldBuilder

func (*FieldBuilder) When

func (f *FieldBuilder) When(name string, t time.Time, options ...MetadataOption) *FieldBuilder

func (*FieldBuilder) Where

func (f *FieldBuilder) Where(name, value string, options ...MetadataOption) *FieldBuilder

func (*FieldBuilder) Who

func (f *FieldBuilder) Who(name, value string, options ...MetadataOption) *FieldBuilder

func (*FieldBuilder) Why

func (f *FieldBuilder) Why(name, value string, options ...MetadataOption) *FieldBuilder

type FieldFilter

type FieldFilter interface {
	Accept(meta FieldMeta) bool
}

type FieldMeta

type FieldMeta struct {
	Kind          FieldType
	Name          string
	DefaultHidden bool
}

type FieldType

type FieldType int
const (
	GID FieldType = iota
	NAME
	WHO
	WHAT
	WHEN
	WHERE
	WHY
	HOW
	DESCRIPTION
	TAG
)

type FieldValue

type FieldValue struct {
	Values set.Set[string]
}

func NewFieldValue

func NewFieldValue(s string) *FieldValue

func (*FieldValue) Add

func (f *FieldValue) Add(s string)

func (FieldValue) String

func (f FieldValue) String() string

type Fielder

type Fielder interface {
	GetFields(builder IFieldBuilder)
}

type Fields

type Fields map[FieldMeta]*FieldValue

type FieldsAccumulator

type FieldsAccumulator struct {
	Lines []Fields
	// contains filtered or unexported fields
}

func NewAccumulator

func NewAccumulator() FieldsAccumulator

func (*FieldsAccumulator) Add

func (acc *FieldsAccumulator) Add(fielder Fielder)

func (*FieldsAccumulator) Fields

func (acc *FieldsAccumulator) Fields() []FieldMeta

func (*FieldsAccumulator) Print

func (acc *FieldsAccumulator) Print(f FieldFilter, l LineFilter, printTitles bool)

type ID

type ID string

func (ID) String

func (i ID) String() string

type IFieldBuilder

type IFieldBuilder interface {
	Who(name, value string, options ...MetadataOption) *FieldBuilder
	What(name, value string, options ...MetadataOption) *FieldBuilder
	Where(name, value string, options ...MetadataOption) *FieldBuilder
	When(name string, t time.Time, options ...MetadataOption) *FieldBuilder
	How(name, value string, options ...MetadataOption) *FieldBuilder
	Why(name, value string, options ...MetadataOption) *FieldBuilder

	Tag(name, value string, options ...MetadataOption) *FieldBuilder

	GID(value string) *FieldBuilder
	Name(value string) *FieldBuilder
	Description(value string) *FieldBuilder
	Done()
}

type Instance

type Instance interface {
	Common
	Id() ID
}

type Instancer

type Instancer interface {
	Instances(context.Context) chan Instance
}

Instancer marks a type that can provide a channel of Instance

type LineFilter

type LineFilter func(fields Fields) bool

type MachineImage

type MachineImage interface {
	Common
}

type MachineImager

type MachineImager interface {
	MachineImages(context.Context) chan MachineImage
}

MachineImager marks a type that can provide a channel of MachineImage

type MetadataOption

type MetadataOption func(meta FieldMeta) FieldMeta

type NameRecord

type NameRecord interface {
	Common
	Ctx() context.Context
	Id() ID
}

type NameRecorder

type NameRecorder interface {
	NameRecords(context.Context) chan NameRecord
}

NameRecorder marks a type that can provide a channel of NameRecord

type Provider

type Provider[T any] func(ctx context.Context) chan T

type ProviderMethod

type ProviderMethod[T Fielder] func(p Provider[T], ctx context.Context) chan T

type RegionalAccount

type RegionalAccount interface {
	Account
	Region() string
}

type RegionalAccounts

type RegionalAccounts []RegionalAccount

func (RegionalAccounts) DBClusters added in v0.5.0

func (a RegionalAccounts) DBClusters(ctx context.Context) chan DBCluster

func (RegionalAccounts) DBInstances added in v0.5.0

func (a RegionalAccounts) DBInstances(ctx context.Context) chan DBInstance

func (RegionalAccounts) Instances

func (a RegionalAccounts) Instances(ctx context.Context) chan Instance

func (RegionalAccounts) MachineImages

func (a RegionalAccounts) MachineImages(ctx context.Context) chan MachineImage

func (RegionalAccounts) Snapshots

func (a RegionalAccounts) Snapshots(ctx context.Context) chan Snapshot

func (RegionalAccounts) Subscriptions added in v0.4.0

func (a RegionalAccounts) Subscriptions(ctx context.Context) chan Subscription

func (RegionalAccounts) Topics added in v0.4.0

func (a RegionalAccounts) Topics(ctx context.Context) chan Topic

func (RegionalAccounts) Volumes

func (a RegionalAccounts) Volumes(ctx context.Context) chan Volume

type Snapshot

type Snapshot interface {
	Common
	Id() ID
	Delete(ctx context.Context, dryRun bool) error
}

type Snapshoter

type Snapshoter interface {
	Snapshots(context.Context) chan Snapshot
}

Snapshoter marks a type that can provide a channel of Snapshot

type Sourcer

type Sourcer interface {
	Source() Fielder
}

type Subscription added in v0.4.0

type Subscription interface {
	Common
}

type Subscriptioner added in v0.4.0

type Subscriptioner interface {
	Subscriptions(context.Context) chan Subscription
}

Subscriptioner marks a type that can provide a channel of Subscription

type Topic added in v0.4.0

type Topic interface {
	Common
}

type Topicer added in v0.4.0

type Topicer interface {
	Topics(context.Context) chan Topic
}

Topicer marks a type that can provide a channel of Topic

type Volume

type Volume interface {
	Common
}

type Volumer

type Volumer interface {
	Volumes(context.Context) chan Volume
}

Volumer marks a type that can provide a channel of Volume

type Zone

type Zone interface {
	Common
	Ctx() context.Context
	Id() ID
}

type Zoner

type Zoner interface {
	Zones(context.Context) chan Zone
}

Zoner marks a type that can provide a channel of Zone

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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