mode

package
v0.0.0-...-02c76fb Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileModeDiff

type FileModeDiff struct {
	Actual   os.FileMode
	Expected os.FileMode
}

FileModeDiff shows a diff of the file modes

func (*FileModeDiff) Changes

func (diff *FileModeDiff) Changes() bool

Changes returns true if the expected file mode differs from the current mode

func (*FileModeDiff) Current

func (diff *FileModeDiff) Current() string

Current shows the current file mode

func (*FileModeDiff) Original

func (diff *FileModeDiff) Original() string

Original shows the original file mode

type Mode

type Mode struct {
	resource.Status

	// path to the file that will be modified
	Destination string `export:"destination"`

	// the mode that the file or directory should be configured with
	Mode os.FileMode `export:"mode"`
}

Mode monitors the mode of a file

func (*Mode) Apply

Apply the changes the Mode

func (*Mode) Check

Check whether the Destination has the right Mode

func (*Mode) Validate

func (t *Mode) Validate() error

Validate Mode

type Preparer

type Preparer struct {
	// Destination specifies which file will be modified by this resource. The
	// file must exist on the system (for example, having been created with
	// `file.content`.)
	Destination string `hcl:"destination" required:"true" nonempty:"true"`

	// Mode is the mode of the file, specified in octal.
	Mode *uint32 `hcl:"mode" base:"8" required:"true"`
}

Preparer for file Mode

Mode monitors the mode of a file

func (*Preparer) Prepare

func (p *Preparer) Prepare(ctx context.Context, render resource.Renderer) (resource.Task, error)

Prepare this resource for use

Jump to

Keyboard shortcuts

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