operations

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdoptPackFile

func AdoptPackFile(pack *types.Pack, fs types.FS, externalPath, internalPath string, force bool) (string, error)

AdoptPackFile moves an external file into the pack and returns the destination path

func CreatePackDirectory

func CreatePackDirectory(pack *types.Pack, fs types.FS, dirname string) error

CreatePackDirectory creates a directory within the pack

func CreatePackFile

func CreatePackFile(pack *types.Pack, fs types.FS, filename, content string) error

CreatePackFile creates a file within the pack with the given content

func CreatePackFileWithMode

func CreatePackFileWithMode(pack *types.Pack, fs types.FS, filename, content string, mode os.FileMode) error

CreatePackFileWithMode creates a file within the pack with specific permissions

func CreatePackIgnoreFile

func CreatePackIgnoreFile(pack *types.Pack, fs types.FS, cfg *config.Config) error

CreatePackIgnoreFile creates a .dodotignore file in the pack

func GetPackFilePath

func GetPackFilePath(pack *types.Pack, filename string) string

GetPackFilePath returns the full path to a file within the pack

func GetPackProvisionedHandlers

func GetPackProvisionedHandlers(pack *types.Pack, store datastore.DataStore) ([]string, error)

GetPackProvisionedHandlers returns a list of all handlers that have been provisioned for this pack. This helps identify which handlers have already been executed.

func IsPackHandlerProvisioned

func IsPackHandlerProvisioned(pack *types.Pack, store datastore.DataStore, handlerName string) (bool, error)

IsPackHandlerProvisioned checks if a specific handler has been provisioned for this pack. This is a business logic function that uses the DataStore's query capabilities.

func PackFileExists

func PackFileExists(pack *types.Pack, fs types.FS, filename string) (bool, error)

PackFileExists checks if a file exists within the pack

func PackHasIgnoreFile

func PackHasIgnoreFile(pack *types.Pack, fs types.FS, cfg *config.Config) (bool, error)

PackHasIgnoreFile checks if the pack has an ignore file

func ReadPackFile

func ReadPackFile(pack *types.Pack, fs types.FS, filename string) ([]byte, error)

ReadPackFile reads a file from within the pack

Types

type Pack

type Pack struct {
	*types.Pack // Embed the types.Pack
}

Pack wraps types.Pack to add higher-level operations that require dependencies on other packages (avoiding circular imports).

func New

func New(p *types.Pack) *Pack

New creates a new Pack wrapper from a types.Pack

func (*Pack) AsTypesPack

func (p *Pack) AsTypesPack() *types.Pack

AsTypesPack returns the underlying types.Pack This is useful when you need to pass it to functions expecting *types.Pack

Jump to

Keyboard shortcuts

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