Documentation ¶
Index ¶
- Variables
- func GenerateSSHKeyPair(size int) ([]byte, []byte, error)
- func GetTerminalHeight() int
- func GetTerminalWidth() int
- func InteractiveTerminal(client *ssh.Client) error
- func NewSSHClient(cred *Credentials) (*ssh.Client, error)
- func WithFilters(fs []string) optsFn
- func WithFormat(format string) optsFn
- func WithHeaders(h []ColumnDefinition) optsFn
- func WithIDsOnly(only bool) optsFn
- func WithMaxWidth(maxwidth int) optsFn
- func WithRdfType(rdfType string) optsFn
- func WithRootNode(root *graph.Resource) optsFn
- func WithSortBy(sortingBy ...string) optsFn
- type Builder
- type ColoredValueColumnDefinition
- type ColumnDefinition
- type ColumnDefinitions
- type Credentials
- type Displayer
- type FirewallRulesColumnDefinition
- type GrantsColumnDefinition
- type RoutesColumnDefinition
- type SliceColumnDefinition
- type StringColumnDefinition
- type TimeColumnDefinition
- type TimeFormat
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultsColumnDefinitions = map[string][]ColumnDefinition{ cloud.Instance: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "AvailabilityZone", Friendly: "Zone"}, StringColumnDefinition{Prop: "Name"}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "State"}, ColoredValues: map[string]color.Attribute{"running": color.FgGreen, "stopped": color.FgRed}, }, StringColumnDefinition{Prop: "Type"}, StringColumnDefinition{Prop: "PublicIp", Friendly: "Public IP"}, StringColumnDefinition{Prop: "PrivateIp", Friendly: "Private IP"}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "LaunchTime", Friendly: "Up Since"}}, StringColumnDefinition{Prop: "KeyName", Friendly: "Access Key"}, }, cloud.Vpc: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name"}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "IsDefault", Friendly: "Default"}, ColoredValues: map[string]color.Attribute{"true": color.FgGreen}, }, StringColumnDefinition{Prop: "State"}, StringColumnDefinition{Prop: "CidrBlock"}, }, cloud.Subnet: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name"}, StringColumnDefinition{Prop: "CidrBlock"}, StringColumnDefinition{Prop: "AvailabilityZone", Friendly: "Zone"}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "DefaultForAz", Friendly: "Default"}, ColoredValues: map[string]color.Attribute{"true": color.FgGreen}, }, StringColumnDefinition{Prop: "VpcId"}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "MapPublicIpOnLaunch", Friendly: "Public"}, ColoredValues: map[string]color.Attribute{"true": color.FgYellow}}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "State"}, ColoredValues: map[string]color.Attribute{"available": color.FgGreen}}, }, cloud.SecurityGroup: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "VpcId"}, FirewallRulesColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "InboundRules", Friendly: "Inbound"}}, FirewallRulesColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "OutboundRules", Friendly: "Outbound"}}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, StringColumnDefinition{Prop: "Description", DisableTruncate: true}, }, cloud.InternetGateway: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, StringColumnDefinition{Prop: "Vpcs", DisableTruncate: true}, }, cloud.RouteTable: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, StringColumnDefinition{Prop: "VpcId"}, StringColumnDefinition{Prop: "Main"}, RoutesColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "Routes"}}, }, cloud.Keypair: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "KeyFingerprint", DisableTruncate: true}, }, cloud.Volume: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, StringColumnDefinition{Prop: "VolumeType", Friendly: "Type"}, StringColumnDefinition{Prop: "State"}, StringColumnDefinition{Prop: "Size", Friendly: "Size (Gb)"}, StringColumnDefinition{Prop: "Encrypted"}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateTime", Friendly: "Created"}}, StringColumnDefinition{Prop: "AvailabilityZone", Friendly: "Zone"}, }, cloud.AvailabilityZone: { StringColumnDefinition{Prop: "Name"}, StringColumnDefinition{Prop: "State"}, StringColumnDefinition{Prop: "Region"}, StringColumnDefinition{Prop: "Messages"}, }, cloud.LoadBalancer: { StringColumnDefinition{Prop: "Name"}, StringColumnDefinition{Prop: "VpcId"}, StringColumnDefinition{Prop: "State"}, StringColumnDefinition{Prop: "DNSName"}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateTime", Friendly: "Created"}}, StringColumnDefinition{Prop: "Scheme"}, }, cloud.TargetGroup: { StringColumnDefinition{Prop: "Name"}, StringColumnDefinition{Prop: "VpcId"}, StringColumnDefinition{Prop: "Matcher"}, StringColumnDefinition{Prop: "Port"}, StringColumnDefinition{Prop: "Protocol"}, StringColumnDefinition{Prop: "HealthCheckIntervalSeconds", Friendly: "HCInterval"}, StringColumnDefinition{Prop: "HealthCheckPath", Friendly: "HCPath"}, StringColumnDefinition{Prop: "HealthCheckPort", Friendly: "HCPort"}, StringColumnDefinition{Prop: "HealthCheckProtocol", Friendly: "HCProtocol"}, }, cloud.Listener: { StringColumnDefinition{Prop: "Id", DisableTruncate: true}, StringColumnDefinition{Prop: "Actions"}, StringColumnDefinition{Prop: "LoadBalancer"}, StringColumnDefinition{Prop: "Port"}, StringColumnDefinition{Prop: "Protocol"}, StringColumnDefinition{Prop: "SslPolicy"}, }, cloud.Database: { StringColumnDefinition{Prop: "Id", DisableTruncate: true}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, StringColumnDefinition{Prop: "AvailabilityZone", Friendly: "Zone"}, StringColumnDefinition{Prop: "Class"}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "Status"}, ColoredValues: map[string]color.Attribute{"available": color.FgGreen}}, StringColumnDefinition{Prop: "AllocatedStorage", Friendly: "Size(Gb)"}, StringColumnDefinition{Prop: "Port"}, StringColumnDefinition{Prop: "Username"}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "Public", Friendly: "Public"}, ColoredValues: map[string]color.Attribute{"true": color.FgYellow}}, StringColumnDefinition{Prop: "Engine"}, StringColumnDefinition{Prop: "EngineVersion", Friendly: "Version"}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateTime", Friendly: "Created"}}, }, cloud.DbSubnetGroup: { StringColumnDefinition{Prop: "Id", DisableTruncate: true}, StringColumnDefinition{Prop: "SubnetGroupStatus", Friendly: "Status"}, StringColumnDefinition{Prop: "Vpc"}, StringColumnDefinition{Prop: "Subnets", DisableTruncate: true}, StringColumnDefinition{Prop: "Description"}, }, cloud.User: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "PasswordLastUsedDate", Friendly: "PasswordLastUsed"}}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate", Friendly: "Created"}}, }, cloud.Role: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate", Friendly: "Created"}}, }, cloud.Policy: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate", Friendly: "Created"}}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "UpdateDate", Friendly: "Updated"}}, }, cloud.Group: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate", Friendly: "Created"}}, }, cloud.Bucket: { StringColumnDefinition{Prop: "Name", DisableTruncate: true}, GrantsColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "Grants"}}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate", Friendly: "Created"}}, }, cloud.Object: { StringColumnDefinition{Prop: "Id", TruncateRight: true}, StringColumnDefinition{Prop: "BucketName", Friendly: "Bucket"}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "ModifiedDate", Friendly: "Modified"}}, StringColumnDefinition{Prop: "OwnerId", TruncateRight: true}, StringColumnDefinition{Prop: "Size"}, StringColumnDefinition{Prop: "Class"}, }, cloud.Subscription: { StringColumnDefinition{Prop: "SubscriptionArn"}, StringColumnDefinition{Prop: "TopicArn"}, StringColumnDefinition{Prop: "Endpoint", DisableTruncate: true}, StringColumnDefinition{Prop: "Protocol"}, StringColumnDefinition{Prop: "Owner"}, }, cloud.Topic: { StringColumnDefinition{Prop: "TopicArn", DisableTruncate: true}, }, cloud.Queue: { StringColumnDefinition{Prop: "Id", Friendly: "URL", DisableTruncate: true}, StringColumnDefinition{Prop: "ApproximateNumberOfMessages", Friendly: "~NbMsg"}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreatedTimestamp", Friendly: "Created"}}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "LastModifiedTimestamp", Friendly: "LastModif"}}, StringColumnDefinition{Prop: "DelaySeconds", Friendly: "Delay(s)"}, }, cloud.Zone: { StringColumnDefinition{Prop: "Id", DisableTruncate: true}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, StringColumnDefinition{Prop: "Comment"}, StringColumnDefinition{Prop: "IsPrivateZone", Friendly: "Private"}, StringColumnDefinition{Prop: "ResourceRecordSetCount", Friendly: "Nb Records"}, StringColumnDefinition{Prop: "CallerReference", DisableTruncate: true}, }, cloud.Record: { StringColumnDefinition{Prop: "Id", Friendly: "AwlessId", DisableTruncate: true}, StringColumnDefinition{Prop: "Type"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, SliceColumnDefinition{StringColumnDefinition{Prop: "Records"}}, StringColumnDefinition{Prop: "TTL"}, }, }
Functions ¶
func GetTerminalHeight ¶
func GetTerminalHeight() int
func GetTerminalWidth ¶
func GetTerminalWidth() int
func InteractiveTerminal ¶
func NewSSHClient ¶
func NewSSHClient(cred *Credentials) (*ssh.Client, error)
func WithFilters ¶
func WithFilters(fs []string) optsFn
func WithFormat ¶
func WithFormat(format string) optsFn
func WithHeaders ¶
func WithHeaders(h []ColumnDefinition) optsFn
func WithIDsOnly ¶
func WithIDsOnly(only bool) optsFn
func WithMaxWidth ¶
func WithMaxWidth(maxwidth int) optsFn
func WithRdfType ¶
func WithRdfType(rdfType string) optsFn
func WithRootNode ¶
func WithSortBy ¶
func WithSortBy(sortingBy ...string) optsFn
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func BuildOptions ¶
func BuildOptions(opts ...optsFn) *Builder
type ColoredValueColumnDefinition ¶
type ColoredValueColumnDefinition struct { StringColumnDefinition ColoredValues map[string]color.Attribute }
type ColumnDefinition ¶
type ColumnDefinition interface {
// contains filtered or unexported methods
}
type ColumnDefinitions ¶
type ColumnDefinitions []ColumnDefinition
type Credentials ¶
type FirewallRulesColumnDefinition ¶
type FirewallRulesColumnDefinition struct {
StringColumnDefinition
}
type GrantsColumnDefinition ¶
type GrantsColumnDefinition struct {
StringColumnDefinition
}
type RoutesColumnDefinition ¶
type RoutesColumnDefinition struct {
StringColumnDefinition
}
type SliceColumnDefinition ¶
type SliceColumnDefinition struct {
StringColumnDefinition
}
type StringColumnDefinition ¶
type TimeColumnDefinition ¶
type TimeColumnDefinition struct { StringColumnDefinition Format TimeFormat }
Click to show internal directories.
Click to hide internal directories.