Documentation ¶
Overview ¶
Package artifacts provides API for manage tests artifacts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NeedToSave ¶
func NeedToSave() bool
NeedToSave returns true if any of saving artifact option envs is not empty.
Types ¶
type Config ¶
type Config interface { SaveOption() SaveOption OutputPath() string SaveInAnyCase() bool }
Config is configuration of artifacts manager
func ConfigFromEnv ¶
func ConfigFromEnv() Config
ConfigFromEnv reads config options from environment variables.
type Hook ¶
Hook calls when before artifact presents and after
func Archivator ¶
Archivator hook for artifacts manager. Archives artifact content.
type Manager ¶
type Manager interface { SaveArtifacts() Config() Config }
Manager saves artifacts
func NewManager ¶
func NewManager(c Config, factory PresenterFactory, finders []Finder, hooks []Hook) Manager
NewManager creates artifacts manager with specific parameters.
type Presenter ¶
type Presenter interface {
Present(artifact Artifact)
}
Presenter exports artifacts
type PresenterFactory ¶
PresenterFactory creates artifact presenters and hooks based on config
func DefaultPresenterFactory ¶
func DefaultPresenterFactory() PresenterFactory
DefaultPresenterFactory returns default presenter factory
type SaveOption ¶
type SaveOption byte
SaveOption means how artifact will save / presented
const ( //SaveAsFiles means that artifacts should be saved as files SaveAsFiles SaveOption = 2 << iota //SaveAsArchive means that artifacts should be saved as archive SaveAsArchive //PrintToConsole means that artifacts should be printed to console PrintToConsole )