converge: github.com/asteris-llc/converge/resource/file/mode Index | Files

package mode

import "github.com/asteris-llc/converge/resource/file/mode"

Index

Package Files

mode.go preparer.go

type FileModeDiff Uses

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

FileModeDiff shows a diff of the file modes

func (*FileModeDiff) Changes Uses

func (diff *FileModeDiff) Changes() bool

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

func (*FileModeDiff) Current Uses

func (diff *FileModeDiff) Current() string

Current shows the current file mode

func (*FileModeDiff) Original Uses

func (diff *FileModeDiff) Original() string

Original shows the original file mode

type Mode Uses

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 Uses

func (t *Mode) Apply(context.Context) (resource.TaskStatus, error)

Apply the changes the Mode

func (*Mode) Check Uses

func (t *Mode) Check(context.Context, resource.Renderer) (resource.TaskStatus, error)

Check whether the Destination has the right Mode

func (*Mode) Validate Uses

func (t *Mode) Validate() error

Validate Mode

type Preparer Uses

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 Uses

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

Prepare this resource for use

Package mode imports 5 packages (graph) and is imported by 1 packages. Updated 2016-12-25. Refresh now. Tools for package owners.