file

package
v0.25.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArguments = Arguments{
	Type:          DetectorFSNotify,
	PollFrequency: time.Minute,
}

DefaultArguments provides the default arguments for the local.file component.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	// Filename indicates the file to watch.
	Filename string `hcl:"filename,attr"`
	// Type indicates how to detect changes to the file.
	Type Detector `hcl:"detector,optional"`
	// PollFrequency determines the frequency to check for changes when Type is
	// UpdateTypePoll.
	PollFrequency time.Duration `hcl:"poll_freqency,optional"`
	// Sensitive marks the file as holding a sensitive value which should not be
	// displayed to the user.
	Sensitive bool `hcl:"sensitive,optional"`
}

Arguments holds values which are used to configure the local.file component.

func (*Arguments) DecodeHCL

func (a *Arguments) DecodeHCL(body hcl.Body, ctx *hcl.EvalContext) error

DecodeHCL implements gohcl.Decoder.

type Component

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

Component implements the local.file component.

func New

func New(o component.Options, args Arguments) (*Component, error)

New creates a new local.file component.

func (*Component) CurrentHealth

func (c *Component) CurrentHealth() component.Health

CurrentHealth implements component.HealthComponent.

func (*Component) Run

func (c *Component) Run(ctx context.Context) error

Run implements component.Component.

func (*Component) Update

func (c *Component) Update(args component.Arguments) error

Update implements component.Compnoent.

type Detector

type Detector int

Detector is used to specify how changes to the file should be detected.

const (
	// DetectorInvalid indicates an invalid UpdateType.
	DetectorInvalid Detector = iota
	// DetectorFSNotify uses filesystem events to wait for changes to the file.
	DetectorFSNotify
	// DetectorPoll will re-read the file on an interval to detect changes.
	DetectorPoll

	// DetectorDefault holds the default UpdateType.
	DetectorDefault = DetectorFSNotify
)

func (Detector) MarshalText

func (ut Detector) MarshalText() (text []byte, err error)

MarshalText implements encoding.TextMarshaler.

func (Detector) String

func (ut Detector) String() string

String returns the string representation of the UpdateType.

func (*Detector) UnmarshalText

func (ut *Detector) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type Exports

type Exports struct {
	// Content of the file.
	Content *hcltypes.OptionalSecret `hcl:"content,attr"`
}

Exports holds values which are exported by the local.file component.

Jump to

Keyboard shortcuts

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