project

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console interface {
	Infof(format string, a ...interface{})
	Info(message string)
}

Console defines the interface to output formatted messages

type Project

type Project struct {
	// contains filtered or unexported fields
}

Project represents the struct used to handle project related operations.

func NewProject

func NewProject(fs afero.Fs, projectDir string, settingsDirName string,
	configFileName string, console Console) *Project

NewProject creates and returns a new Project struct instance.

func (*Project) CleanupTmpDir

func (p *Project) CleanupTmpDir() error

CleanupTmpDir removes the project's temporary directory. If the temporary directory does not exist, it does not return any errors.

func (*Project) ConfigFilePath

func (p *Project) ConfigFilePath() string

ConfigFilePath returns the path to the project's configuration file.

func (*Project) Initialize

func (p *Project) Initialize() error

Initialize initializes a new project with starter files.

func (*Project) ProjectDir

func (p *Project) ProjectDir() string

ProjectDir returns the path to the project's root dir

func (*Project) WriteTmpFile

func (p *Project) WriteTmpFile(relativeFilePath string, content []byte) (string, error)

WriteTmpFile writes a file to the temporary directory of the project. The provided path is treated as relative to the project's temporary directory. If any directories in the path do not exist, they are created. If the file in path already exists, it is overwritten. On success it returns the absolute path to the new file. If there is an error, it returns that error. In most cases callers should call the Project.CleanupTmpDir function after calling this function usually with a defer to ensure that the tmp dir has been cleaned up.

Jump to

Keyboard shortcuts

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