local

package
v0.5.0-2a Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package local provides primitive resources backed by the local filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Library

func Library() *runtime.Library

Library returns the registration record for the `local` library. Stacks reach its resources as `resources: { local: { file: { ... } } }`.

Types

type File

type File struct {
	Path            string
	Content         string
	Mode            int64
	CreateDirectory bool
}

File writes a regular file to the local filesystem. The file's path is part of the input set; changing the path replaces the resource (the prior file is deleted and a new one is written at the new path). CreateDirectory opts the resource into creating any missing parent directories of Path. Without it, a missing parent is an error so callers do not accidentally write outside an expected tree.

func (*File) Create

func (f *File) Create(_ context.Context, _ any) (*FileOutput, error)

func (*File) Delete

func (f *File) Delete(_ context.Context, _ any, _ *FileOutput) error

func (*File) Read

func (f *File) Read(_ context.Context, _ any, _ *FileOutput) (*FileOutput, error)

func (*File) ReplaceFields

func (f *File) ReplaceFields() []string

func (*File) SchemaVersion

func (f *File) SchemaVersion() int

func (*File) Update

func (f *File) Update(
	_ context.Context, _ any, _ runtime.Prior[File, *FileOutput],
) (*FileOutput, error)

type FileOutput

type FileOutput struct {
	SHA256 string
	Size   int64
}

FileOutput is what gets stored in state after Create / Update. It holds only what writing the file computes; path is an input and is readable as one, so it is not copied here.

Jump to

Keyboard shortcuts

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