fs

package
v0.0.0-...-3af8ba7 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Usage in lua configuration file

Directory({
        Path    = "/tmp/haiconf/testdirectory",
        Mode    = "0755",
        Owner   = "jerome",
        Group   = "wheel",
        Recurse = true,
        Ensure  = "present",
    })

Index

Constants

View Source
const (
	DEFAULT_MODE_DIRECTORY = os.FileMode(0755)
	DEFAULT_MODE_FILE      = os.FileMode(0644)
)

Variables

This section is empty.

Functions

func Chmod

func Chmod(path string, mode os.FileMode) error

func Chown

func Chown(path string, usr *user.User, grp *hacks.Group) error

func MkDir

func MkDir(path string, recurse bool, mode os.FileMode) error

func RmDir

func RmDir(path string, recurse bool) error

Types

type Directory

type Directory struct {
	Path    string
	Mode    os.FileMode
	Owner   *user.User
	Recurse bool
	Ensure  string

	// no user.Group in golang yet
	// (https://code.google.com/p/go/issues/detail?id=2617)
	// Let's use a temporary one
	Group *hacks.Group
	// contains filtered or unexported fields
}

func (*Directory) Run

func (d *Directory) Run() error

func (*Directory) SetDefault

func (d *Directory) SetDefault(rc *haiconf.RuntimeConfig) error

func (*Directory) SetUserConfig

func (d *Directory) SetUserConfig(args haiconf.CommandArgs) error

type File

type File struct {
	Path   string
	Mode   os.FileMode
	Ensure string
	Owner  *user.User
	Group  *hacks.Group
	Source string

	TemplateVariables map[string]interface{}
	// contains filtered or unexported fields
}

func (*File) Run

func (f *File) Run() error

func (*File) SetDefault

func (f *File) SetDefault(rc *haiconf.RuntimeConfig) error

func (*File) SetUserConfig

func (f *File) SetUserConfig(args haiconf.CommandArgs) error

Jump to

Keyboard shortcuts

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