model

package
v0.0.0-...-0bed249 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config map[interface{}]interface{}

Config holds the default configuration values for prefab

Functions

func GetApplicationTypes

func GetApplicationTypes() ([]string, error)

GetApplicationTypes returns a list of applications types

func GetConfigAsYaml

func GetConfigAsYaml() string

GetConfigAsYaml will return the serialized version of the glocal config

func GetSCMTypes

func GetSCMTypes() []string

GetSCMTypes gets the list of the configured SCM's

func LoadConfig

func LoadConfig(filename string) error

LoadConfig read the default configuration vales for prefab from the given filename

func SaveConfig

func SaveConfig(filename string) error

SaveConfig saved the updated configuration values to the specified file

Types

type Application

type Application struct {
	Name           string
	Type           string
	Repo           string
	Summary        string
	Config         map[string]string
	LocalDirectory string
	SCM
}

Application describes a template of the app repo

func GetApplications

func GetApplications(appType string) []Application

GetApplications returns a list of applications of the specified types

type Environment

type Environment struct {
	Name           string
	Type           string
	Repo           string
	Summary        string
	LocalDirectory string
	Config         map[string]string
	SCM
}

Environment describes a build or a run environment

func GetBuildEnvironmentTypes

func GetBuildEnvironmentTypes() ([]Environment, error)

GetBuildEnvironmentTypes returns a list of supported environment types

func GetRuntimeEnvironmentTypes

func GetRuntimeEnvironmentTypes() ([]Environment, error)

GetRuntimeEnvironmentTypes returns a list of supported environment types

type Project

type Project struct {
	Name           string
	PID            uint32
	LocalDirectory string
	Environments   map[string]Environment
	Applications   map[string]Application
}

Project parameters

var CurrentProject *Project

CurrentProject values

func (*Project) AddApplication

func (p *Project) AddApplication(app Application) error

AddApplication Validates and adds to teh Environment collection

func (*Project) AddEnvironment

func (p *Project) AddEnvironment(env Environment) error

AddEnvironment Validates and adds to teh Environment collection

func (*Project) ApplyValues

func (p *Project) ApplyValues()

ApplyValues will subsitute any go templates

func (*Project) GetProjectFilename

func (p *Project) GetProjectFilename() string

GetProjectFilename gets the full path of the project settings file

func (*Project) LoadProject

func (p *Project) LoadProject() error

LoadProject based on name and LocalDirectory

func (*Project) SaveProject

func (p *Project) SaveProject() error

SaveProject will the save the vales in the project struct

func (*Project) SetLocalDirectory

func (p *Project) SetLocalDirectory(path string) error

SetLocalDirectory Validates and Sets the local path where the generated files will be placed.

func (*Project) SetProjectName

func (p *Project) SetProjectName(name string) error

SetProjectName Validates and Sets the projectName

type SCM

type SCM struct {
	Name  string
	Type  string
	Users []User
	URL   string
}

SCM holds the parameters required for connecting to github, gogs, gitlab etc.,

type User

type User struct {
	Username string
	APIToken string
}

User strucure

Jump to

Keyboard shortcuts

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