record

package
v0.0.0-...-674084c Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operation

type Operation struct {
	// contains filtered or unexported fields
}

Operation is an entry in the Recording.

func (Operation) MarshalJSON

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type OperationKind

type OperationKind string

OperationKind is the name of a recorded operation

const (
	// ImportFile is a js import from the filesystem (exclude stdlib imports).
	ImportFile OperationKind = "import-file"
	// ParameterFile is a file holding input parameters specified with the -f switch.
	ParameterFile OperationKind = "parameter-file"
	// ReadFile is a std.read from the filesystem (exclude reading from stdin).
	ReadFile OperationKind = "read-file"
)

type Params

type Params map[string]interface{}

Params are Operation parameters we can record along with an entry.

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

Recorder records Operations. It's designed to be generic, any part of jk can append an operation to the log.

func (*Recorder) Log

func (r *Recorder) Log() []Operation

Log retrieves the recording list of operations

func (Recorder) MarshalJSON

func (r Recorder) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Recorder) Record

func (r *Recorder) Record(kind OperationKind, params Params)

Record appends a new operation to the log.

Jump to

Keyboard shortcuts

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