filesystem

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: PostgreSQL Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceTypeDir resource.Type = "filesystem.dir"

Variables

This section is empty.

Functions

func ChownRecursive

func ChownRecursive(fsys afero.Fs, path string, uid, gid int) error

func DirResourceFullPath

func DirResourceFullPath(rc *resource.Context, resourceID string) (string, error)

func DirResourceIdentifier

func DirResourceIdentifier(id string) resource.Identifier

func Provide

func Provide(i *do.Injector)

func RegisterResourceTypes

func RegisterResourceTypes(registry *resource.Registry)

Types

type DirResource

type DirResource struct {
	ID       string      `json:"id"`
	ParentID string      `json:"parent_id"`
	HostID   string      `json:"host_id"`
	Path     string      `json:"path"`
	OwnerUID int         `json:"owner_uid"`
	OwnerGID int         `json:"owner_gid"`
	Perm     os.FileMode `json:"perm"`
	FullPath string      `json:"full_path"`
}

func (*DirResource) Create

func (d *DirResource) Create(ctx context.Context, rc *resource.Context) error

func (*DirResource) Delete

func (d *DirResource) Delete(ctx context.Context, rc *resource.Context) error

func (*DirResource) Dependencies

func (d *DirResource) Dependencies() []resource.Identifier

func (*DirResource) DiffIgnore

func (d *DirResource) DiffIgnore() []string

func (*DirResource) Executor

func (d *DirResource) Executor() resource.Executor

func (*DirResource) Identifier

func (d *DirResource) Identifier() resource.Identifier

func (*DirResource) Refresh

func (d *DirResource) Refresh(ctx context.Context, rc *resource.Context) error

func (*DirResource) ResourceVersion

func (d *DirResource) ResourceVersion() string

func (*DirResource) Update

func (d *DirResource) Update(ctx context.Context, rc *resource.Context) error

type Directory

type Directory struct {
	Path     string      `json:"path"`
	Mode     os.FileMode `json:"mode"`
	Children []TreeNode  `json:"children"`
}

func (*Directory) Create

func (d *Directory) Create(ctx context.Context, fs afero.Fs, parent string, ownerUID int) error

type File

type File struct {
	Path     string      `json:"path"`
	Mode     os.FileMode `json:"mode"`
	Contents []byte      `json:"contents"`
}

func (*File) Create

func (f *File) Create(ctx context.Context, fs afero.Fs, parent string, ownerUID int) error

type TreeNode

type TreeNode interface {
	Create(ctx context.Context, fs afero.Fs, parent string, ownerUID int) error
}

Jump to

Keyboard shortcuts

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