project

package
v0.0.0-...-4303c5a Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Content embed.FS

Functions

func GetScriptContent

func GetScriptContent(name string) string

func ListConfigs

func ListConfigs() []string

func PrintFullList

func PrintFullList()

PrintFullList prints the list of sessions

func PrintShortList

func PrintShortList()

PrintShortList prints the list of sessions

Types

type Project

type Project struct {
	Name           string   `json:"name"`
	ProjectType    string   `json:"type"`
	Description    string   `json:"description"`
	Directory      string   `json:"directory"`
	SetupActions   []string `json:"setupactions"`
	Repos          []Repo   `json:"repos"`
	Targets        []Target `json:"targets"`
	Root           string   `json:"root"` // Root type of the project directory or git url
	HomeDir        string   `json:"-"`
	ProjectTypeDir string   `json:"-"` // Directory where project type files are located
	Pattern        string   `json:"-"` // pattern obtained from ProjectType
	GOARCH         string   `json:"-"` // target architecture
	GOOS           string   `json:"-"` // target operating system
	GOPATH         string   `json:"-"` // Go paths
	USER           string   `json:"-"` // Username
	Exists         bool     `json:"-"` // project exists
}

Project defines a structure of a project

func NewProject

func NewProject(projectname string) *Project

NewProject initialize a Project object

func (Project) Archive

func (proj Project) Archive(archivedescr string) error

func (Project) CalcDestination

func (proj Project) CalcDestination(instr string) string

func (Project) Confess

func (proj Project) Confess()

func (*Project) InitializeProject

func (proj *Project) InitializeProject(projtype string, safe bool) error

func (*Project) InjectExternal

func (proj *Project) InjectExternal()

func (*Project) InjectProjectType

func (proj *Project) InjectProjectType(projtype string) error

func (Project) ListFiles

func (proj Project) ListFiles() []string

func (Project) LoadFile

func (proj Project) LoadFile(target string) (string, error)

func (Project) NameIsValid

func (proj Project) NameIsValid() bool

func (*Project) Open

func (proj *Project) Open() error

func (Project) Parse

func (proj Project) Parse(templatestring string) string

buildConfig construct the text from the template definition and arguments.

func (Project) ProcessTarget

func (proj Project) ProcessTarget(element *Target) error

func (Project) ProjectConfigFile

func (proj Project) ProjectConfigFile() string

func (*Project) Read

func (proj *Project) Read(reader io.Reader) error

Read session content from a io.Reader object.

func (*Project) RefreshStruct

func (proj *Project) RefreshStruct(args ...string) error

RefreshStruct refreshes the project structure by loading the project configuration file. It checks if the project exists and if not, it injects the project type configuration.

func (Project) Save

func (proj Project) Save() error

Write session configuration to a projectfile

func (*Project) SetDescription

func (proj *Project) SetDescription(instr ...string)

func (Project) Write

func (proj Project) Write(writer io.Writer) error

Write json output to an io.Writer compatible handle. It returns nil or the error of json.MarshalIndent

type Repo

type Repo struct {
	Url         string `json:"url"`
	Destination string `json:"destination"`
	Branch      string `json:"branch"`
}

Repo defines the struct of a (git) repository

type Target

type Target struct {
	Name        string `json:"name"`
	Destination string `json:"destination"`
	Mode        string `json:"mode"`
	Content     string `json:"-"`
}

Target defines a structure of a file

func (Target) Confess

func (projt Target) Confess()

Jump to

Keyboard shortcuts

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