linuxgen

package
v0.0.0-...-f078915 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

README

linuxgen

import "github.com/blueprint-uservices/blueprint/plugins/linuxcontainer/linuxgen"

Index

func ExecuteTemplate

func ExecuteTemplate(name string, body string, args any) (string, error)

func ExecuteTemplateToFile

func ExecuteTemplateToFile(name string, body string, args any, filename string) error

func GenerateRunFunc

func GenerateRunFunc(name string, runfunc string, deps ...ir.IRNode) (string, error)

type BuildScript

type BuildScript struct {
    WorkspaceDir string
    FileName     string
    FilePath     string
    Scripts      map[string]*scriptInfo
}

func NewBuildScript
func NewBuildScript(workspaceDir, fileName string) *BuildScript

Creates a new build.sh that will invoke multiple build scripts of processes in subdirectories of the workspace

func (*BuildScript) Add
func (d *BuildScript) Add(filePath string) error

Adds a process's build script to the workspace's build.sh

filePath should be a fully qualified path to a build script that resides within a subdirectory of the workspace

Returns an error if the script resides outside of the workspace

func (*BuildScript) GenerateBuildScript
func (d *BuildScript) GenerateBuildScript() error

type RunScript

type RunScript struct {
    WorkspaceName string
    WorkspaceDir  string
    FileName      string
    FilePath      string
    RunFuncs      map[string]string    // Function bodies provided by processes
    AllNodes      map[string]ir.IRNode // All nodes seen by this run script
    Args          map[string]ir.IRNode // Arguments that will be set in calling the environment
}

func NewRunScript
func NewRunScript(workspaceName, workspaceDir, fileName string) *RunScript

Creates a new run.sh that will check environment variables are set and invokes the run scripts of the processes within the workspace

func (*RunScript) Add
func (run *RunScript) Add(procName, runfunc string, deps ...ir.IRNode)

func (*RunScript) GenerateRunScript
func (run *RunScript) GenerateRunScript() error

func (*RunScript) Require
func (run *RunScript) Require(node ir.IRNode)

Indicate that the specified node is required within this namespace; either it is built by its own runfunc, or it must be provided as argument.

We use this so that the generated run.sh knows which environment variables will be needed or used by the processes it runs.

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteTemplate

func ExecuteTemplate(name string, body string, args any) (string, error)

func ExecuteTemplateToFile

func ExecuteTemplateToFile(name string, body string, args any, filename string) error

func GenerateRunFunc

func GenerateRunFunc(name string, runfunc string, deps ...ir.IRNode) (string, error)

Types

type BuildScript

type BuildScript struct {
	WorkspaceDir string
	FileName     string
	FilePath     string
	Scripts      map[string]*scriptInfo
}

func NewBuildScript

func NewBuildScript(workspaceDir, fileName string) *BuildScript

Creates a new build.sh that will invoke multiple build scripts of processes in subdirectories of the workspace

func (*BuildScript) Add

func (d *BuildScript) Add(filePath string) error

Adds a process's build script to the workspace's build.sh

filePath should be a fully qualified path to a build script that resides within a subdirectory of the workspace

Returns an error if the script resides outside of the workspace

func (*BuildScript) GenerateBuildScript

func (d *BuildScript) GenerateBuildScript() error

type RunScript

type RunScript struct {
	WorkspaceName string
	WorkspaceDir  string
	FileName      string
	FilePath      string
	RunFuncs      map[string]string    // Function bodies provided by processes
	AllNodes      map[string]ir.IRNode // All nodes seen by this run script
	Args          map[string]ir.IRNode // Arguments that will be set in calling the environment
}

func NewRunScript

func NewRunScript(workspaceName, workspaceDir, fileName string) *RunScript

Creates a new run.sh that will check environment variables are set and invokes the run scripts of the processes within the workspace

func (*RunScript) Add

func (run *RunScript) Add(procName, runfunc string, deps ...ir.IRNode)

func (*RunScript) GenerateRunScript

func (run *RunScript) GenerateRunScript() error

func (*RunScript) Require

func (run *RunScript) Require(node ir.IRNode)

Indicate that the specified node is required within this namespace; either it is built by its own runfunc, or it must be provided as argument.

We use this so that the generated run.sh knows which environment variables will be needed or used by the processes it runs.

Jump to

Keyboard shortcuts

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