pprint

package
v0.0.1-beta1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package pprint contains the root elements required by the plugin

Index

Constants

View Source
const (
	// BlockPrint plugin block identifier.
	BlockPrint = "print"
	// AttributePrefix name of the argument used in the block print.
	AttributePrefix = "prefix"
	// AttributeMsg name of the argument used in the block print.
	AttributeMsg = "msg"
	// AttributeTimestamp name of the argument used in the block print.
	AttributeTimestamp = "showTimestamp"
	// AttributeTimestampFormat name of the argument used in the block print.
	AttributeTimestampFormat = "timestampFormat"
	// AttributeFormat name of the argument used in the block print.
	AttributeFormat = "format"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct{}

Decoder struct used to implement required interfaces.

func (*Decoder) BlockHeaderSchema

func (dec *Decoder) BlockHeaderSchema() hcl.BlockHeaderSchema

BlockHeaderSchema return the header schema for the plugin.

func (*Decoder) DecodeBlock

func (dec *Decoder) DecodeBlock(block *hcl.Block) (actions.Action, errors.Error)

DecodeBlock required to implement the plugin interface.

type Print

type Print struct {
	*actions.Base
	// contains filtered or unexported fields
}

Print plugin structure used to marshal the block definition.

func (*Print) Execute

func (p *Print) Execute(ctx context.FeatureContext) errors.Error

Execute functin in charge of executing the plugin.

func (*Print) Format

func (p *Print) Format(ctx *hcl.EvalContext) (string, errors.Error)

Format returns the format in which the format in which the message must be printed out.

func (*Print) Msg

func (p *Print) Msg(ctx *hcl.EvalContext) (string, errors.Error)

Msg returns the message after evaluating the expression.

func (*Print) MustShowTimestamp

func (p *Print) MustShowTimestamp(ctx *hcl.EvalContext) (bool, errors.Error)

MustShowTimestamp returns if timestamp must be shown after evaluating the expression.

func (*Print) Prefix

func (p *Print) Prefix(ctx *hcl.EvalContext) (string, errors.Error)

Prefix returns the prefix after evaluating the expression.

func (*Print) SetFormat

func (p *Print) SetFormat(expr hcl.Expression)

SetFormat used to populate the attribute format in the struct.

func (*Print) SetMessage

func (p *Print) SetMessage(expr hcl.Expression)

SetMessage used to populate the attribute msg in the struct.

func (*Print) SetPrefix

func (p *Print) SetPrefix(expr hcl.Expression)

SetPrefix used to populate the attribute prefix in the struct.

func (*Print) SetTimestamp

func (p *Print) SetTimestamp(expr hcl.Expression)

SetTimestamp used to populate the attribute timestamp in the struct.

func (*Print) SetTimestampFormat

func (p *Print) SetTimestampFormat(expr hcl.Expression)

SetTimestampFormat used to populate the attribute timestampFormat in the struct.

func (*Print) TimestampFormat

func (p *Print) TimestampFormat(ctx *hcl.EvalContext) (string, errors.Error)

TimestampFormat returns the format in which the timestamp must be shown after evaluating the expression.

Directories

Path Synopsis
Package internal contains not exported types and functions
Package internal contains not exported types and functions

Jump to

Keyboard shortcuts

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