Documentation ¶
Index ¶
- Constants
- func ApprovalWrite(ctx Context, approvals []*types.Approval) error
- func DeploymentWrite(ctx Context, Deployments []Deployment) error
- type ApprovalContext
- func (c *ApprovalContext) Created() string
- func (c *ApprovalContext) Delta() string
- func (c *ApprovalContext) Identifier() string
- func (c *ApprovalContext) MarshalJSON() ([]byte, error)
- func (c *ApprovalContext) Provider() string
- func (c *ApprovalContext) Rejected() string
- func (c *ApprovalContext) Votes() string
- type Context
- type Deployment
- type DeploymentContext
- type Format
- type HeaderContext
- type SubFormat
Constants ¶
const ( ApprovalIdentifierHeader = "Identifier" ApprovalDeltaHeader = "Delta" ApprovalVotesHeader = "Votes" ApprovalRejectedHeader = "Rejected" ApprovalProviderHeader = "Provider" ApprovalCreatedHeader = "Created" )
Formatter headers
const ( DeploymentNamespaceHeader = "NAMESPACE" DeploymentNameHeader = "NAME" DeploymentReadyHeader = "READY" DeploymentImagesHeader = "IMAGES" )
Formatter headers
const ( TableFormatKey = "table" RawFormatKey = "raw" PrettyFormatKey = "pretty" )
Format keys used to specify certain kinds of output formats
Variables ¶
This section is empty.
Functions ¶
func ApprovalWrite ¶
ApprovalWrite writes formatted approvals using the Context
func DeploymentWrite ¶
func DeploymentWrite(ctx Context, Deployments []Deployment) error
DeploymentWrite writes formatted deployments using the Context
Types ¶
type ApprovalContext ¶
type ApprovalContext struct { HeaderContext // contains filtered or unexported fields }
ApprovalContext - approval context is a container for each line
func (*ApprovalContext) Created ¶
func (c *ApprovalContext) Created() string
func (*ApprovalContext) Delta ¶
func (c *ApprovalContext) Delta() string
func (*ApprovalContext) Identifier ¶
func (c *ApprovalContext) Identifier() string
func (*ApprovalContext) MarshalJSON ¶
func (c *ApprovalContext) MarshalJSON() ([]byte, error)
MarshalJSON - marshal to json (inspect)
func (*ApprovalContext) Provider ¶
func (c *ApprovalContext) Provider() string
func (*ApprovalContext) Rejected ¶
func (c *ApprovalContext) Rejected() string
func (*ApprovalContext) Votes ¶
func (c *ApprovalContext) Votes() 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 // Trunc when set to true will truncate the output of certain fields such as Container ID. Trunc bool // contains filtered or unexported fields }
Context contains information required by the formatter to print the output as desired.
type Deployment ¶
type Deployment struct { Namespace string `json:"namespace,omitempty"` Name string `json:"name,omitempty"` CreatedAt time.Time Replicas int32 AvailableReplicas int32 Images []string `json:"images,omitempty"` // image:tag list }
Deployment - internal deployment, used to better represent keel related info
type DeploymentContext ¶
type DeploymentContext struct { HeaderContext // contains filtered or unexported fields }
DeploymentContext - deployment context is a container for each line
func (*DeploymentContext) Images ¶
func (c *DeploymentContext) Images() string
Images - print used images
func (*DeploymentContext) MarshalJSON ¶
func (c *DeploymentContext) MarshalJSON() ([]byte, error)
MarshalJSON - marshal to json (inspect)
func (*DeploymentContext) Namespace ¶
func (c *DeploymentContext) Namespace() string
Namespace - print namespace
func (*DeploymentContext) Ready ¶
func (c *DeploymentContext) Ready() string
Ready - print readiness
type Format ¶
type Format string
Format is the format string rendered using the Context
func NewApprovalsFormat ¶
NewApprovalsFormat returns a format for use with a approval Context
func NewDeploymentsFormat ¶
NewDeploymentsFormat returns a format for use with a deployment Context
type HeaderContext ¶
type HeaderContext struct {
// contains filtered or unexported fields
}
HeaderContext provides the subContext interface for managing headers
func (*HeaderContext) AddHeader ¶
func (c *HeaderContext) AddHeader(header string)
AddHeader adds another column to the header
func (*HeaderContext) FullHeader ¶
func (c *HeaderContext) FullHeader() string
FullHeader returns the header as a string