Documentation ¶
Index ¶
Constants ¶
const ( // DetailTypeInfo indicates a detail of type info. DetailTypeInfo = "INFO" // DetailTypeWarn indicates a detail of type warning. DetailTypeWarn = "WARN" // DetailTypeError indicates a detail of type error. DetailTypeError = "ERROR" )
const ( // StateDeploySuccess indicates a config was successfully deployed. StateDeploySuccess = "SUCCESS" // StateDeployError indicates a config could not be deployed due to an error. StateDeployError = "ERROR" // StateDeployExcluded indicates no attempt was made to deploy a config because it was marked by the user to skip. StateDeployExcluded = "EXCLUDED" // StateDeploySkipped indicates no attempt was made to deploy a config because one or mored dependencies were skipped or excluded. StateDeploySkipped = "SKIPPED" )
const (
TypeDeploy = "DEPLOY"
)
Variables ¶
This section is empty.
Functions ¶
func NewContextWithDetailer ¶
NewContextWithDetailer returns a copy of the specified Context associated with the specified Detailer.
Types ¶
type Detail ¶
type Detail struct { // Type is the type of detail: info, warning or error. Type string `json:"type"` // Message is the message of the detail. Message string `json:"msg"` }
Detail represents additional information produced during the deployment of an configuration.
type Detailer ¶
type Detailer interface { // Add adds a Detail to the Detailer. Add(d Detail) // GetAll gets all Details stored by the Detailer. GetAll() []Detail }
// Reporter is a minimal interface for recording and retrieving details.
func GetDetailerFromContextOrDiscard ¶
GetDetailerFromContextOrDiscard gets the Detailer associated with the Context or returns a discarding Detailer if none is available.
func NewDefaultDetailer ¶
func NewDefaultDetailer() Detailer
NewDefaultDetailer creates a Detailer that simply stores Details in a slice.
type JSONTime ¶
JSONTime represents a time.Time value that is serialized as a string in RFC3339 format.
func (JSONTime) MarshalJSON ¶
MarshalJSON marshals a JSONTime value into a RFC3339 string.
func (*JSONTime) UnmarshalJSON ¶
UnmarshalJSON unmarshals a JSONTime value from a RFC3339 string.
type Record ¶
type Record struct { // Type is the type of record, currently TypeDeploy. Type string `json:"type"` // Time is the time associated with the Record. Time JSONTime `json:"time"` // Config provides the config ID, project and type of the config associated with the Record. Config coordinate.Coordinate `json:"config"` // State is the result of the deployment of the config, currently StateDeploySuccess, StateDeployError, StateDeployExcluded, StateDeploySkipped. State string `json:"state"` // Details optionally provides Detail log entries associated with the record. Details []Detail `json:"details,omitempty"` // Error optionally provides the string representation of any error associated with the Record. Error *string `json:"error,omitempty"` }
Record is a single entry in a report.
type Reporter ¶
type Reporter interface { // ReportDeployment reports the result of deploying a config. ReportDeployment(config coordinate.Coordinate, state string, details []Detail, err error) // GetSummary returns a summary of all seen events as a string. GetSummary() string // Stop shuts down the Reporter, writing out all records. Stop() }
Reporter is a minimal interface for reporting events and retrieving summaries.
func GetReporterFromContextOrDiscard ¶
GetReporterFromContextOrDiscard gets the Reporter associated with the Context or returns a discarding Reporter if none is available.