Documentation
¶
Index ¶
- Constants
- func ConvertMapToFunctionConfigWithStatus(functionMap map[string]interface{}) (*functionconfig.ConfigWithStatus, error)
- func GetUnmarshalFunc(bytes []byte) (func(data []byte, v interface{}) error, error)
- func OpenFile(filepath string) (*os.File, error)
- func ReadFromInOrStdin(r io.Reader) ([]byte, error)
- func RenderAPIGateways(apiGateways []platform.APIGateway, format string, writer io.Writer, ...) error
- func RenderFunctionEvents(functionEvents []platform.FunctionEvent, format string, writer io.Writer, ...) error
- func RenderFunctions(ctx context.Context, logger logger.Logger, functions []platform.Function, ...) error
- func RenderProjects(ctx context.Context, projects []platform.Project, format string, ...) error
- type FailReport
- type FunctionReports
- func (fr *FunctionReports) AddFailure(name string, err error, canBeAutoFixed bool)
- func (fr *FunctionReports) AddSuccess(name string)
- func (fr *FunctionReports) PrintAsTable(t table.Writer, onlyFailed bool)
- func (fr *FunctionReports) SaveToFile(ctx context.Context, loggerInstance logger.Logger, path string)
- func (fr *FunctionReports) SprintfError() string
- type PatchManifest
- func (m *PatchManifest) AddFailure(name string, err error, retryable bool)
- func (m *PatchManifest) AddSkipped(name string)
- func (m *PatchManifest) AddSuccess(name string)
- func (m *PatchManifest) GetFailed() map[string]failDescription
- func (m *PatchManifest) GetRetryableFunctionNames() []string
- func (m *PatchManifest) GetSkipped() []string
- func (m *PatchManifest) GetSuccess() []string
- func (m *PatchManifest) LogOutput(ctx context.Context, loggerInstance logger.Logger)
- func (m *PatchManifest) SaveToFile(ctx context.Context, loggerInstance logger.Logger, path string)
- func (m *PatchManifest) SprintfError() string
- type ProjectReport
- type ProjectReports
- func (pr *ProjectReports) AddReport(report *ProjectReport)
- func (pr *ProjectReports) GetReport(projectName string) (report *ProjectReport, exists bool)
- func (pr *ProjectReports) PrintAsTable(t table.Writer, onlyFailed bool)
- func (pr *ProjectReports) SaveToFile(ctx context.Context, loggerInstance logger.Logger, path string)
- func (pr *ProjectReports) SprintfError() string
- type Report
Constants ¶
View Source
const ( OutputFormatText = "text" OutputFormatWide = "wide" OutputFormatJSON = "json" OutputFormatYAML = "yaml" )
Variables ¶
This section is empty.
Functions ¶
func ConvertMapToFunctionConfigWithStatus ¶
func ConvertMapToFunctionConfigWithStatus(functionMap map[string]interface{}) (*functionconfig.ConfigWithStatus, error)
ConvertMapToFunctionConfigWithStatus converts a map to a function config with status
func GetUnmarshalFunc ¶
func OpenFile ¶
OpenFile validates filepath existence and returns a file (it is the caller's responsibility to close it)
func RenderAPIGateways ¶
func RenderAPIGateways(apiGateways []platform.APIGateway, format string, writer io.Writer, renderCallback func(apiGateways []platform.APIGateway, renderer func(interface{}) error) error) error
func RenderFunctionEvents ¶
func RenderFunctionEvents(functionEvents []platform.FunctionEvent, format string, writer io.Writer, renderCallback func(functions []platform.FunctionEvent, renderer func(interface{}) error) error) error
func RenderFunctions ¶
func RenderFunctions(ctx context.Context, logger logger.Logger, functions []platform.Function, format string, writer io.Writer, renderCallback func(functions []platform.Function, renderer func(interface{}) error, exportOptions *common.ExportFunctionOptions) error, exportOptions *common.ExportFunctionOptions) error
Types ¶
type FailReport ¶
type FunctionReports ¶
type FunctionReports struct {
Success []string `json:"success,omitempty"`
Failed map[string]*FailReport `json:"failed,omitempty"`
// contains filtered or unexported fields
}
func NewFunctionReports ¶
func NewFunctionReports() *FunctionReports
func (*FunctionReports) AddFailure ¶
func (fr *FunctionReports) AddFailure(name string, err error, canBeAutoFixed bool)
func (*FunctionReports) AddSuccess ¶
func (fr *FunctionReports) AddSuccess(name string)
func (*FunctionReports) PrintAsTable ¶
func (fr *FunctionReports) PrintAsTable(t table.Writer, onlyFailed bool)
func (*FunctionReports) SaveToFile ¶
func (*FunctionReports) SprintfError ¶
func (fr *FunctionReports) SprintfError() string
type PatchManifest ¶
type PatchManifest struct {
// contains filtered or unexported fields
}
func NewPatchManifest ¶
func NewPatchManifest() *PatchManifest
func NewPatchManifestFromFile ¶
func NewPatchManifestFromFile(path string) (*PatchManifest, error)
func (*PatchManifest) AddFailure ¶
func (m *PatchManifest) AddFailure(name string, err error, retryable bool)
func (*PatchManifest) AddSkipped ¶
func (m *PatchManifest) AddSkipped(name string)
func (*PatchManifest) AddSuccess ¶
func (m *PatchManifest) AddSuccess(name string)
func (*PatchManifest) GetFailed ¶
func (m *PatchManifest) GetFailed() map[string]failDescription
func (*PatchManifest) GetRetryableFunctionNames ¶
func (m *PatchManifest) GetRetryableFunctionNames() []string
func (*PatchManifest) GetSkipped ¶
func (m *PatchManifest) GetSkipped() []string
func (*PatchManifest) GetSuccess ¶
func (m *PatchManifest) GetSuccess() []string
func (*PatchManifest) LogOutput ¶
func (m *PatchManifest) LogOutput(ctx context.Context, loggerInstance logger.Logger)
func (*PatchManifest) SaveToFile ¶
func (*PatchManifest) SprintfError ¶
func (m *PatchManifest) SprintfError() string
type ProjectReport ¶
type ProjectReport struct {
Name string `json:"name,omitempty"`
Skipped bool `json:"skipped,omitempty"`
Success bool `json:"success,omitempty"`
Failed *FailReport `json:"failed,omitempty"`
FunctionReports *FunctionReports `json:"functionReports,omitempty"`
}
func NewProjectReport ¶
func NewProjectReport(name string) *ProjectReport
func (*ProjectReport) PrintAsTable ¶
func (pr *ProjectReport) PrintAsTable(t table.Writer, onlyFailed bool)
func (*ProjectReport) SaveToFile ¶
func (*ProjectReport) SetFailed ¶
func (pr *ProjectReport) SetFailed(failReport *FailReport)
SetFailed sets the "Failed" status if it hasn't been set yet. In other words, it retains only the first error that occurred.
func (*ProjectReport) SprintfError ¶
func (pr *ProjectReport) SprintfError() string
type ProjectReports ¶
type ProjectReports struct {
Reports map[string]*ProjectReport `json:"reports,omitempty"`
}
func NewProjectReports ¶
func NewProjectReports() *ProjectReports
func (*ProjectReports) AddReport ¶
func (pr *ProjectReports) AddReport(report *ProjectReport)
func (*ProjectReports) GetReport ¶
func (pr *ProjectReports) GetReport(projectName string) (report *ProjectReport, exists bool)
func (*ProjectReports) PrintAsTable ¶
func (pr *ProjectReports) PrintAsTable(t table.Writer, onlyFailed bool)
func (*ProjectReports) SaveToFile ¶
func (*ProjectReports) SprintfError ¶
func (pr *ProjectReports) SprintfError() string
type Report ¶
type Report interface {
// SaveToFile saves a report to file on a given path
SaveToFile(ctx context.Context, loggerInstance logger.Logger, path string)
// SprintfError generates string with detailed error
SprintfError() string
// PrintAsTable adds rows to the provided table writer
PrintAsTable(t table.Writer, onlyFailed bool)
}
Click to show internal directories.
Click to hide internal directories.