composeloader

package module
v0.0.0-...-b64921f Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigFromPath

func ConfigFromPath(path string, additional ...string) (types.ConfigDetails, error)

ConfigFromPath converts paths to types.ConfigDetails. It only examines readability of paths and makes up types.ConfigDetails from them.

WorkingDir will be set to the parent directory of path. Environment will be os.Environ.

If any path is not readable or points to a non regular file, it stop and returns the first error encountered.

func PreloadConfigDetails

func PreloadConfigDetails(conf types.ConfigDetails) (types.ConfigDetails, error)

PreloadConfigDetails loads content and parse content if each corresponding field is not present in given conf.

func ReloadConfigDetails

func ReloadConfigDetails(conf types.ConfigDetails) (types.ConfigDetails, error)

ReloadConfigDetails is almost identical to PreloadConfigDetails however this function erases each file's Content and Config fields before loading.

Types

type ComposeArchive

type ComposeArchive struct {
	Archive     fs.FS
	ComposePath string
}

type Loader

type Loader struct {
	Config  types.ConfigDetails
	Options [](func(*loader.Options))
}

func FromDir

func FromDir[S, H any](d *ProjectDir[S, H], options []func(*loader.Options)) (*Loader, error)

func (*Loader) Load

func (l *Loader) Load(ctx context.Context) (*types.Project, error)

func (*Loader) Preload

func (l *Loader) Preload() error

func (*Loader) Reload

func (l *Loader) Reload() error

type ProjectDir

type ProjectDir[S, H any] struct {
	// contains filtered or unexported fields
}

ProjectDir is handle for a directory that contains compose.yml and all relevant files.

func NewSimpleProjectDir

func NewSimpleProjectDir(
	dir string,
	archive ComposeArchive,
) (*ProjectDir[any, any], error)

func PrepareProjectDir

func PrepareProjectDir[S, H any](
	dir string,
	archivePath string,
	archive ComposeArchive,
	pathSet S,
	initialContent any,
) (*ProjectDir[S, H], error)

func (*ProjectDir[S, H]) ComposeYmlPath

func (d *ProjectDir[S, H]) ComposeYmlPath() string

func (*ProjectDir[S, H]) Dir

func (d *ProjectDir[S, H]) Dir() string

func (*ProjectDir[S, H]) PathHandle

func (d *ProjectDir[S, H]) PathHandle() H

func (*ProjectDir[S, H]) PathSet

func (d *ProjectDir[S, H]) PathSet() S

Jump to

Keyboard shortcuts

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