Documentation
¶
Index ¶
- Constants
- func BackupWrite(ctx Context, Backups []ybmclient.BackupData) error
- func CMKWrite(ctx Context, cmkSpec ybmclient.CMKSpec) error
- func CdcSinkWrite(ctx Context, cdcSinks []ybmclient.CdcSinkData) error
- func CdcStreamWrite(ctx Context, cdcStreams []ybmclient.CdcStreamData) error
- func CloudRegionWrite(ctx Context, cloudRegions []ybmclient.RegionListResponseDataItem) error
- func ClusterWrite(ctx Context, clusters []ybmclient.ClusterData) error
- func Colorize(message string, colors string) string
- func ConvertBytestoGb(sizeInB int64) string
- func EndpointWrite(ctx Context, endpoints []ybmclient.Endpoint) error
- func FormatDate(dateToBeFormatted string) string
- func InstanceTypeWrite(ctx Context, instanceTypes []ybmclient.NodeConfigurationResponseItem) error
- func NetworkAllowListWrite(ctx Context, nals []ybmclient.NetworkAllowListData) error
- func NewClusterInfoRegionsContext() *clusterInfoRegionsContext
- func NodeHealthToEmoji(status bool) string
- func NodeTypeToEmoji(nodeType bool) string
- func NodeWrite(ctx Context, node []ybmclient.NodeData) error
- func PSEndpointWrite(ctx Context, pseData ybmclient.PrivateServiceEndpointRegionData, ...) error
- func ReadReplicaWrite(ctx Context, rrSpecs []ybmclient.ReadReplicaSpec, ...) error
- func Truncate(text string, lenght int) string
- func VPCPeeringWrite(ctx Context, VPCPeerings []ybmclient.VpcPeeringData) error
- func VPCWrite(ctx Context, VPCs []ybmclient.SingleTenantVpcDataResponse) error
- type BackupContext
- func (c *BackupContext) BackupState() string
- func (c *BackupContext) BackupType() string
- func (c *BackupContext) ClusterName() string
- func (c *BackupContext) CreatedOn() string
- func (c *BackupContext) Description() string
- func (c *BackupContext) ExpireOn() string
- func (c *BackupContext) Id() string
- func (c *BackupContext) MarshalJSON() ([]byte, error)
- func (c *BackupContext) RetainInDays() string
- type CMKContext
- type CdcSinkContext
- type CdcStreamContext
- func (c *CdcStreamContext) DBName() string
- func (c *CdcStreamContext) KafkaPrefix() string
- func (c *CdcStreamContext) LagTime() string
- func (c *CdcStreamContext) MarshalJSON() ([]byte, error)
- func (c *CdcStreamContext) Name() string
- func (c *CdcStreamContext) State() string
- func (c *CdcStreamContext) Tables() string
- type CloudRegionContext
- type ClusterContext
- func (c *ClusterContext) DataDistribution() string
- func (c *ClusterContext) FaultTolerance() string
- func (c *ClusterContext) HealthState() string
- func (c *ClusterContext) ID() string
- func (c *ClusterContext) MarshalJSON() ([]byte, error)
- func (c *ClusterContext) Name() string
- func (c *ClusterContext) Nodes() string
- func (c *ClusterContext) NodesSpec() string
- func (c *ClusterContext) Provider() string
- func (c *ClusterContext) Regions() string
- func (c *ClusterContext) SoftwareVersion() string
- func (c *ClusterContext) State() string
- func (c *ClusterContext) Tier() string
- type Context
- type EndpointContext
- type Format
- func NewBackupFormat(source string) Format
- func NewCMKFormat(source string) Format
- func NewCdcSinkFormat(source string) Format
- func NewCdcStreamFormat(source string) Format
- func NewCloudRegionFormat(source string) Format
- func NewClusterFormat(source string) Format
- func NewEndpointFormat(source string) Format
- func NewFullClusterFormat(source string) Format
- func NewInstanceTypeFormat(source string) Format
- func NewNetworkAllowListFormat(source string) Format
- func NewNodeFormat(source string) Format
- func NewPSEndpointFormat(source string) Format
- func NewReadReplicaFormat(source string) Format
- func NewVPCFormat(source string) Format
- func NewVPCPeeringFormat(source string) Format
- type FullClusterContext
- type HeaderContext
- type InstanceTypeContext
- type NetworkAllowListContext
- type NodeContext
- type PSEndpointFullContext
- func (ep *PSEndpointFullContext) ActiveConnections() string
- func (ep *PSEndpointFullContext) Az() string
- func (ep *PSEndpointFullContext) MarshalJSON() ([]byte, error)
- func (ep *PSEndpointFullContext) SecurityPrincipals() string
- func (ep *PSEndpointFullContext) ServiceName() string
- func (ep *PSEndpointFullContext) SetFullPSEndpoint(authApi client.AuthApiClient, ...)
- func (ep *PSEndpointFullContext) State() string
- func (ep *PSEndpointFullContext) Write() error
- type ReadReplicaContext
- type SubContext
- type SubFormat
- type SubHeaderContext
- type VPCContext
- func (c *VPCContext) CIDR() string
- func (c *VPCContext) Clusters() string
- func (c *VPCContext) MarshalJSON() ([]byte, error)
- func (c *VPCContext) Name() string
- func (c *VPCContext) Peerings() string
- func (c *VPCContext) Provider() string
- func (c *VPCContext) Regions() string
- func (c *VPCContext) RegionsCIDR() string
- func (c *VPCContext) State() string
- type VPCPeeringContext
Constants ¶
const ( TableFormatKey = "table" RawFormatKey = "raw" PrettyFormatKey = "pretty" JSONFormatKey = "json" DefaultQuietFormat = "{{.ID}}" GREEN_COLOR = "green" RED_COLOR = "red" )
Format keys used to specify certain kinds of output formats
Variables ¶
This section is empty.
Functions ¶
func BackupWrite ¶
func BackupWrite(ctx Context, Backups []ybmclient.BackupData) error
BackupWrite renders the context for a list of backups
func CdcSinkWrite ¶
func CdcSinkWrite(ctx Context, cdcSinks []ybmclient.CdcSinkData) error
CdcSinkWrite renders the context for a list of cdc sinks
func CdcStreamWrite ¶
func CdcStreamWrite(ctx Context, cdcStreams []ybmclient.CdcStreamData) error
CdStreamWrite renders the context for a list of cdc streams
func CloudRegionWrite ¶
func CloudRegionWrite(ctx Context, cloudRegions []ybmclient.RegionListResponseDataItem) error
CloudRegionWrite renders the context for a list of cloud regions
func ClusterWrite ¶
func ClusterWrite(ctx Context, clusters []ybmclient.ClusterData) error
ClusterWrite renders the context for a list of clusters
func ConvertBytestoGb ¶ added in v0.0.15
convertMbtoGb convert MB to GB
func EndpointWrite ¶ added in v0.0.14
func InstanceTypeWrite ¶
func InstanceTypeWrite(ctx Context, instanceTypes []ybmclient.NodeConfigurationResponseItem) error
InstanceTypeWrite renders the context for a list of instance types
func NetworkAllowListWrite ¶
func NetworkAllowListWrite(ctx Context, nals []ybmclient.NetworkAllowListData) error
NetworkAllowListWrite renders the context for a list of network allow lists
func NewClusterInfoRegionsContext ¶ added in v0.0.6
func NewClusterInfoRegionsContext() *clusterInfoRegionsContext
func NodeHealthToEmoji ¶ added in v0.0.15
func NodeTypeToEmoji ¶ added in v0.0.15
func PSEndpointWrite ¶ added in v0.0.15
func ReadReplicaWrite ¶
func ReadReplicaWrite(ctx Context, rrSpecs []ybmclient.ReadReplicaSpec, rrEndpoints []ybmclient.Endpoint) error
ReadReplicaWrite renders the context for a list of read replicas
func VPCPeeringWrite ¶
func VPCPeeringWrite(ctx Context, VPCPeerings []ybmclient.VpcPeeringData) error
VPCPeeringWrite renders the context for a list of VPC Peerings
Types ¶
type BackupContext ¶
type BackupContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewBackupContext ¶
func NewBackupContext() *BackupContext
NewBackupContext creates a new context for rendering Backup
func (*BackupContext) BackupState ¶
func (c *BackupContext) BackupState() string
func (*BackupContext) BackupType ¶
func (c *BackupContext) BackupType() string
func (*BackupContext) ClusterName ¶
func (c *BackupContext) ClusterName() string
func (*BackupContext) CreatedOn ¶
func (c *BackupContext) CreatedOn() string
func (*BackupContext) Description ¶
func (c *BackupContext) Description() string
func (*BackupContext) ExpireOn ¶
func (c *BackupContext) ExpireOn() string
func (*BackupContext) Id ¶
func (c *BackupContext) Id() string
func (*BackupContext) MarshalJSON ¶
func (c *BackupContext) MarshalJSON() ([]byte, error)
func (*BackupContext) RetainInDays ¶
func (c *BackupContext) RetainInDays() string
type CMKContext ¶ added in v0.1.5
type CMKContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewCMKContext ¶ added in v0.1.5
func NewCMKContext() *CMKContext
func (*CMKContext) KeyAlias ¶ added in v0.1.5
func (c *CMKContext) KeyAlias() string
func (*CMKContext) MarshalJSON ¶ added in v0.1.5
func (c *CMKContext) MarshalJSON() ([]byte, error)
func (*CMKContext) Provider ¶ added in v0.1.5
func (c *CMKContext) Provider() string
func (*CMKContext) SecurityPrincipals ¶ added in v0.1.5
func (c *CMKContext) SecurityPrincipals() string
type CdcSinkContext ¶
type CdcSinkContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewCdcSinkContext ¶
func NewCdcSinkContext() *CdcSinkContext
NewCdcSinkContext creates a new context for rendering cdc sink
func (*CdcSinkContext) HostName ¶
func (c *CdcSinkContext) HostName() string
func (*CdcSinkContext) MarshalJSON ¶
func (c *CdcSinkContext) MarshalJSON() ([]byte, error)
func (*CdcSinkContext) Name ¶
func (c *CdcSinkContext) Name() string
func (*CdcSinkContext) State ¶
func (c *CdcSinkContext) State() string
func (*CdcSinkContext) Type ¶
func (c *CdcSinkContext) Type() string
type CdcStreamContext ¶
type CdcStreamContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewCdcStreamContext ¶
func NewCdcStreamContext() *CdcStreamContext
NewCdcStreamContext creates a new context for rendering cdc stream
func (*CdcStreamContext) DBName ¶
func (c *CdcStreamContext) DBName() string
func (*CdcStreamContext) KafkaPrefix ¶
func (c *CdcStreamContext) KafkaPrefix() string
func (*CdcStreamContext) LagTime ¶
func (c *CdcStreamContext) LagTime() string
func (*CdcStreamContext) MarshalJSON ¶
func (c *CdcStreamContext) MarshalJSON() ([]byte, error)
func (*CdcStreamContext) Name ¶
func (c *CdcStreamContext) Name() string
func (*CdcStreamContext) State ¶
func (c *CdcStreamContext) State() string
func (*CdcStreamContext) Tables ¶
func (c *CdcStreamContext) Tables() string
type CloudRegionContext ¶
type CloudRegionContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewCloudRegionContext ¶
func NewCloudRegionContext() *CloudRegionContext
NewCloudRegionContext creates a new context for rendering cloud regions
func (*CloudRegionContext) CountryCode ¶
func (c *CloudRegionContext) CountryCode() string
func (*CloudRegionContext) MarshalJSON ¶
func (c *CloudRegionContext) MarshalJSON() ([]byte, error)
func (*CloudRegionContext) RegionCode ¶
func (c *CloudRegionContext) RegionCode() string
func (*CloudRegionContext) RegionName ¶
func (c *CloudRegionContext) RegionName() string
type ClusterContext ¶
type ClusterContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewClusterContext ¶
func NewClusterContext() *ClusterContext
NewClusterContext creates a new context for rendering cluster
func (*ClusterContext) DataDistribution ¶ added in v0.0.6
func (c *ClusterContext) DataDistribution() string
func (*ClusterContext) FaultTolerance ¶ added in v0.0.6
func (c *ClusterContext) FaultTolerance() string
func (*ClusterContext) HealthState ¶
func (c *ClusterContext) HealthState() string
func (*ClusterContext) ID ¶ added in v0.0.6
func (c *ClusterContext) ID() string
func (*ClusterContext) MarshalJSON ¶
func (c *ClusterContext) MarshalJSON() ([]byte, error)
func (*ClusterContext) Name ¶
func (c *ClusterContext) Name() string
func (*ClusterContext) Nodes ¶
func (c *ClusterContext) Nodes() string
func (*ClusterContext) NodesSpec ¶
func (c *ClusterContext) NodesSpec() string
func (*ClusterContext) Provider ¶ added in v0.0.6
func (c *ClusterContext) Provider() string
func (*ClusterContext) Regions ¶
func (c *ClusterContext) Regions() string
Return single region or the first regions with +number of others region
func (*ClusterContext) SoftwareVersion ¶
func (c *ClusterContext) SoftwareVersion() string
func (*ClusterContext) State ¶
func (c *ClusterContext) State() string
func (*ClusterContext) Tier ¶ added in v0.0.13
func (c *ClusterContext) Tier() string
type Context ¶
type Context struct {
// Output is the output stream to which the formatted string is written.
Output io.Writer
// Format is used to choose raw, table or custom format for the output.
Format Format
// contains filtered or unexported fields
}
Context contains information required by the formatter to print the output as desired.
type EndpointContext ¶ added in v0.0.14
type EndpointContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewEndpointContext ¶ added in v0.0.14
func NewEndpointContext() *EndpointContext
func (*EndpointContext) Accessibility ¶ added in v0.0.14
func (e *EndpointContext) Accessibility() string
func (*EndpointContext) Host ¶ added in v0.0.14
func (e *EndpointContext) Host() string
func (*EndpointContext) Id ¶ added in v0.0.15
func (e *EndpointContext) Id() string
func (*EndpointContext) MarshalJSON ¶ added in v0.0.14
func (e *EndpointContext) MarshalJSON() ([]byte, error)
func (*EndpointContext) Region ¶ added in v0.0.14
func (e *EndpointContext) Region() string
func (*EndpointContext) State ¶ added in v0.0.14
func (e *EndpointContext) State() string
type Format ¶
type Format string
Format is the format string rendered using the Context
func NewBackupFormat ¶
func NewCMKFormat ¶ added in v0.1.5
func NewCdcSinkFormat ¶
func NewCdcStreamFormat ¶
func NewCloudRegionFormat ¶
func NewClusterFormat ¶
func NewEndpointFormat ¶ added in v0.0.14
func NewFullClusterFormat ¶ added in v0.0.6
func NewInstanceTypeFormat ¶
func NewNodeFormat ¶ added in v0.0.15
func NewPSEndpointFormat ¶ added in v0.0.15
func NewReadReplicaFormat ¶
func NewVPCFormat ¶
func NewVPCPeeringFormat ¶
func (Format) IsPrettyJson ¶
IsJSON returns true if the format is the json format
type FullClusterContext ¶ added in v0.0.6
type FullClusterContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewFullClusterContext ¶ added in v0.0.6
func NewFullClusterContext() *FullClusterContext
NewFullClusterContext creates a new context for rendering cluster
func (*FullClusterContext) SetFullCluster ¶ added in v0.0.6
func (c *FullClusterContext) SetFullCluster(authApi client.AuthApiClient, clusterData ybmclient.ClusterData)
func (*FullClusterContext) SubSection ¶ added in v0.0.6
func (c *FullClusterContext) SubSection(name string)
func (*FullClusterContext) Write ¶ added in v0.0.6
func (c *FullClusterContext) Write() error
type HeaderContext ¶
type HeaderContext struct {
Header interface{}
}
HeaderContext provides the subContext interface for managing headers
func (*HeaderContext) FullHeader ¶
func (c *HeaderContext) FullHeader() interface{}
FullHeader returns the header as an interface
type InstanceTypeContext ¶
type InstanceTypeContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewInstanceTypeContext ¶
func NewInstanceTypeContext() *InstanceTypeContext
NewInstanceTypeContext creates a new context for rendering cloud regions
func (*InstanceTypeContext) AZs ¶
func (c *InstanceTypeContext) AZs() int32
func (*InstanceTypeContext) Cores ¶
func (c *InstanceTypeContext) Cores() int32
func (*InstanceTypeContext) DiskSize ¶
func (c *InstanceTypeContext) DiskSize() int32
func (*InstanceTypeContext) IsEnabled ¶
func (c *InstanceTypeContext) IsEnabled() bool
func (*InstanceTypeContext) MarshalJSON ¶
func (c *InstanceTypeContext) MarshalJSON() ([]byte, error)
func (*InstanceTypeContext) Memory ¶
func (c *InstanceTypeContext) Memory() int32
type NetworkAllowListContext ¶
type NetworkAllowListContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewNetworkAllowListContext ¶
func NewNetworkAllowListContext() *NetworkAllowListContext
NewNetworkAllowListContext creates a new context for rendering nal
func (*NetworkAllowListContext) AllowedList ¶
func (c *NetworkAllowListContext) AllowedList() string
func (*NetworkAllowListContext) Clusters ¶
func (c *NetworkAllowListContext) Clusters() string
func (*NetworkAllowListContext) Desc ¶
func (c *NetworkAllowListContext) Desc() string
func (*NetworkAllowListContext) MarshalJSON ¶
func (c *NetworkAllowListContext) MarshalJSON() ([]byte, error)
func (*NetworkAllowListContext) Name ¶
func (c *NetworkAllowListContext) Name() string
type NodeContext ¶ added in v0.0.15
type NodeContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewNodeContext ¶ added in v0.0.15
func NewNodeContext() *NodeContext
func (*NodeContext) IsMaster ¶ added in v0.0.15
func (n *NodeContext) IsMaster() string
func (*NodeContext) IsNodeUp ¶ added in v0.0.15
func (n *NodeContext) IsNodeUp() string
func (*NodeContext) IsRR ¶ added in v0.0.15
func (n *NodeContext) IsRR() string
func (*NodeContext) IsTserver ¶ added in v0.0.15
func (n *NodeContext) IsTserver() string
func (*NodeContext) MemoryUsed ¶ added in v0.0.15
func (n *NodeContext) MemoryUsed() string
func (*NodeContext) Name ¶ added in v0.0.15
func (n *NodeContext) Name() string
func (*NodeContext) RegionZone ¶ added in v0.0.15
func (n *NodeContext) RegionZone() string
type PSEndpointFullContext ¶ added in v0.0.15
type PSEndpointFullContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewPSEndpointContext ¶ added in v0.0.15
func NewPSEndpointContext() *PSEndpointFullContext
func (*PSEndpointFullContext) ActiveConnections ¶ added in v0.0.15
func (ep *PSEndpointFullContext) ActiveConnections() string
func (*PSEndpointFullContext) Az ¶ added in v0.0.15
func (ep *PSEndpointFullContext) Az() string
func (*PSEndpointFullContext) MarshalJSON ¶ added in v0.0.15
func (ep *PSEndpointFullContext) MarshalJSON() ([]byte, error)
func (*PSEndpointFullContext) SecurityPrincipals ¶ added in v0.0.15
func (ep *PSEndpointFullContext) SecurityPrincipals() string
func (*PSEndpointFullContext) ServiceName ¶ added in v0.0.15
func (ep *PSEndpointFullContext) ServiceName() string
func (*PSEndpointFullContext) SetFullPSEndpoint ¶ added in v0.0.15
func (ep *PSEndpointFullContext) SetFullPSEndpoint(authApi client.AuthApiClient, pseData ybmclient.PrivateServiceEndpointRegionData, endpoint ybmclient.Endpoint)
func (*PSEndpointFullContext) State ¶ added in v0.0.15
func (ep *PSEndpointFullContext) State() string
func (*PSEndpointFullContext) Write ¶ added in v0.0.15
func (ep *PSEndpointFullContext) Write() error
type ReadReplicaContext ¶
type ReadReplicaContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewReadReplicaContext ¶
func NewReadReplicaContext() *ReadReplicaContext
NewReadReplicaContext creates a new context for rendering readReplica
func (*ReadReplicaContext) Endpoint ¶
func (c *ReadReplicaContext) Endpoint() string
func (*ReadReplicaContext) MarshalJSON ¶ added in v0.1.1
func (c *ReadReplicaContext) MarshalJSON() ([]byte, error)
func (*ReadReplicaContext) Nodes ¶
func (c *ReadReplicaContext) Nodes() string
func (*ReadReplicaContext) NodesSpec ¶
func (c *ReadReplicaContext) NodesSpec() string
func (*ReadReplicaContext) Region ¶
func (c *ReadReplicaContext) Region() string
func (*ReadReplicaContext) State ¶
func (c *ReadReplicaContext) State() string
type SubContext ¶
type SubContext interface {
FullHeader() interface{}
}
SubContext defines what Context implementation should provide
type SubFormat ¶
type SubFormat func(func(SubContext) error) error
SubFormat is a function type accepted by Write()
type SubHeaderContext ¶
SubHeaderContext is a map destined to formatter header (table format)
func (SubHeaderContext) Label ¶
func (c SubHeaderContext) Label(name string) string
Label returns the header label for the specified string
type VPCContext ¶
type VPCContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewVPCContext ¶
func NewVPCContext() *VPCContext
NewVPCContext creates a new context for rendering VPC
func (*VPCContext) CIDR ¶ added in v0.0.6
func (c *VPCContext) CIDR() string
func (*VPCContext) Clusters ¶
func (c *VPCContext) Clusters() string
func (*VPCContext) MarshalJSON ¶
func (c *VPCContext) MarshalJSON() ([]byte, error)
func (*VPCContext) Name ¶
func (c *VPCContext) Name() string
func (*VPCContext) Peerings ¶
func (c *VPCContext) Peerings() string
func (*VPCContext) Provider ¶
func (c *VPCContext) Provider() string
func (*VPCContext) Regions ¶ added in v0.0.6
func (c *VPCContext) Regions() string
func (*VPCContext) RegionsCIDR ¶
func (c *VPCContext) RegionsCIDR() string
func (*VPCContext) State ¶
func (c *VPCContext) State() string
type VPCPeeringContext ¶
type VPCPeeringContext struct {
HeaderContext
Context
// contains filtered or unexported fields
}
func NewVPCPeeringContext ¶
func NewVPCPeeringContext() *VPCPeeringContext
NewVPCPeeringContext creates a new context for rendering VPC Peering
func (*VPCPeeringContext) AppVPC ¶
func (c *VPCPeeringContext) AppVPC() string
func (*VPCPeeringContext) MarshalJSON ¶
func (c *VPCPeeringContext) MarshalJSON() ([]byte, error)
func (*VPCPeeringContext) Name ¶
func (c *VPCPeeringContext) Name() string
func (*VPCPeeringContext) Provider ¶
func (c *VPCPeeringContext) Provider() string
func (*VPCPeeringContext) Status ¶
func (c *VPCPeeringContext) Status() string
func (*VPCPeeringContext) YbVPC ¶
func (c *VPCPeeringContext) YbVPC() string