commandsummary

package
v2.53.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// The name of the directory where all the commands summaries will be stored.
	// Inside this directory, each command will have its own directory.
	OutputDirName = "jfrog-command-summary"
)

Variables

This section is empty.

Functions

func ShouldRecordSummary

func ShouldRecordSummary() bool

If the output dir path is not defined, the command summary should not be recorded.

func UnmarshalFromFilePath

func UnmarshalFromFilePath(dataFile string, target any) (err error)

Helper function to unmarshal data from a file path into the target object.

Types

type CommandSummary

type CommandSummary struct {
	CommandSummaryInterface
	// contains filtered or unexported fields
}

func New

func New(userImplementation CommandSummaryInterface, commandsName string) (cs *CommandSummary, err error)

Create a new instance of CommandSummary. Notice to check if the command should record the summary before calling this function. You can do this by calling the helper function ShouldRecordSummary.

func (*CommandSummary) Record

func (cs *CommandSummary) Record(data any) (err error)

This function stores the current data on the file system. It then invokes the GenerateMarkdownFromFiles function on all existing data files. Finally, it saves the generated markdown file to the file system.

type CommandSummaryInterface

type CommandSummaryInterface interface {
	GenerateMarkdownFromFiles(dataFilePaths []string) (finalMarkdown string, err error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL