Documentation ¶
Index ¶
- Variables
- func GenerateSSHKeyPair(size int) ([]byte, []byte, error)
- func GetTerminalWidth() int
- func InteractiveTerminal(client *ssh.Client) error
- func NewSSHClient(keyDirectory string, cred *Credentials) (*ssh.Client, error)
- func WithFormat(format string) optsFn
- func WithHeaders(h []ColumnDefinition) optsFn
- func WithIDsOnly(only bool) optsFn
- func WithMaxWidth(maxwidth int) optsFn
- func WithRdfType(rdfType graph.ResourceType) optsFn
- func WithRootNode(root *graph.Resource) optsFn
- func WithSortBy(sortingBy ...string) optsFn
- type Builder
- type ColoredValueColumnDefinition
- type ColumnDefinition
- type Credentials
- type Displayer
- type FirewallRulesColumnDefinition
- type GrantsColumnDefinition
- type RoutesColumnDefinition
- type StringColumnDefinition
- type TimeColumnDefinition
- type TimeFormat
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultsColumnDefinitions = map[graph.ResourceType][]ColumnDefinition{ graph.Instance: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "SubnetId"}, StringColumnDefinition{Prop: "Name"}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "State"}, ColoredValues: map[string]color.Attribute{"running": color.FgGreen, "stopped": color.FgRed}, }, StringColumnDefinition{Prop: "Type"}, StringColumnDefinition{Prop: "KeyName", Friendly: "Access Key"}, StringColumnDefinition{Prop: "PublicIp", Friendly: "Public IP"}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "LaunchTime"}}, }, graph.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"}, }, graph.Subnet: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name"}, StringColumnDefinition{Prop: "CidrBlock"}, StringColumnDefinition{Prop: "AvailabilityZone", Friendly: "Zone"}, StringColumnDefinition{Prop: "VpcId"}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "MapPublicIpOnLaunch", Friendly: "Public VMs"}, ColoredValues: map[string]color.Attribute{"true": color.FgYellow}}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "State"}, ColoredValues: map[string]color.Attribute{"available": color.FgGreen}}, ColoredValueColumnDefinition{ StringColumnDefinition: StringColumnDefinition{Prop: "DefaultForAz", Friendly: "ZoneDefault"}, ColoredValues: map[string]color.Attribute{"true": color.FgGreen}, }, }, graph.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}, }, graph.InternetGateway: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, StringColumnDefinition{Prop: "Vpcs", DisableTruncate: true}, }, graph.RouteTable: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, StringColumnDefinition{Prop: "VpcId"}, StringColumnDefinition{Prop: "Main"}, RoutesColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "Routes"}}, }, graph.Keypair: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "KeyFingerprint", DisableTruncate: true}, }, graph.Volume: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, StringColumnDefinition{Prop: "VolumeType"}, StringColumnDefinition{Prop: "State"}, StringColumnDefinition{Prop: "Size", Friendly: "Size (Gb)"}, StringColumnDefinition{Prop: "Encrypted"}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateTime"}}, StringColumnDefinition{Prop: "AvailabilityZone"}, }, graph.User: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "PasswordLastUsedDate", Friendly: "PasswordLastUsed"}}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate"}}, }, graph.Role: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate"}}, }, graph.Policy: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate"}}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "UpdateDate"}}, }, graph.Group: { StringColumnDefinition{Prop: "Id"}, StringColumnDefinition{Prop: "Name", DisableTruncate: true}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate"}}, }, graph.Bucket: { StringColumnDefinition{Prop: "Name", DisableTruncate: true}, GrantsColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "Grants"}}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "CreateDate"}}, }, graph.Object: { StringColumnDefinition{Prop: "Key", TruncateRight: true}, StringColumnDefinition{Prop: "BucketName"}, TimeColumnDefinition{StringColumnDefinition: StringColumnDefinition{Prop: "ModifiedDate"}}, StringColumnDefinition{Prop: "OwnerId", TruncateRight: true}, StringColumnDefinition{Prop: "Size"}, StringColumnDefinition{Prop: "Class"}, }, }
Functions ¶
func GetTerminalWidth ¶
func GetTerminalWidth() int
func InteractiveTerminal ¶
func NewSSHClient ¶
func NewSSHClient(keyDirectory string, cred *Credentials) (*ssh.Client, error)
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 graph.ResourceType) 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 Credentials ¶
type FirewallRulesColumnDefinition ¶
type FirewallRulesColumnDefinition struct {
StringColumnDefinition
}
type GrantsColumnDefinition ¶
type GrantsColumnDefinition struct {
StringColumnDefinition
}
type RoutesColumnDefinition ¶
type RoutesColumnDefinition struct {
StringColumnDefinition
}
type StringColumnDefinition ¶
type TimeColumnDefinition ¶
type TimeColumnDefinition struct { StringColumnDefinition Format TimeFormat }
Click to show internal directories.
Click to hide internal directories.