project

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigDir = "." + util.AppKey
View Source
const DefaultGoVersion = "1.21"

Variables

View Source
var AllBuildOptions = []*BuildOption{
	{Key: "simple", Title: "Simple", Description: "Only build Linux amd64 and a single Docker image (ignores all other build options)"},

	{Key: "private", Title: "Private", Description: "This project is not public (affects publishing)"},
	{Key: "changelog", Title: "Changelog", Description: "Generate changelogs from Github commits"},
	{Key: "testsFail", Title: "Tests Fail", Description: "If set, Docker build will fail unless all tests pass"},

	{Key: "desktop", Title: "Desktop", Description: "Webview-based applications for the three major operating systems (requires \"desktop\" module)"},
	{Key: "notarize", Title: "Notarize", Description: "Sends build artifacts to Apple for notarization (requires \"notarize\" module)"},
	{Key: "signing", Title: "Signing", Description: "Signs the checksums using gpg"},

	{Key: "android", Title: "Android", Description: "Builds the application as an Android library and webview-based APK (requires \"android\" module)"},
	{Key: "ios", Title: "iOS", Description: "Builds the application as an iOS framework and webview-based app (requires \"ios\" module)"},
	{Key: "wasm", Title: "WASM", Description: "Builds the application for WebAssembly (requires the \"wasm\" module)"},
	{Key: "x86", Title: "32-bit x86", Description: "Builds 32-bit versions of the products"},

	{Key: "windows-arm", Title: "Windows ARM", Description: "Builds the application for Windows on ARM and ARM64 architectures"},
	{Key: "linux-arm", Title: "Linux ARM", Description: "Builds the application for Linux on ARM and ARM64 architectures"},
	{Key: "linux-mips", Title: "Linux MIPS", Description: "Builds the application for Linux on MIPS architectures"},
	{Key: "linux-odd", Title: "Linux Odd", Description: "Builds the application for Linux using ppc64, ppc64le, riscv64, and s390x"},

	{Key: "aix", Title: "AIX", Description: "Builds the application for AIX"},
	{Key: "dragonfly", Title: "Dragonfly", Description: "Builds the application for Dragonfly"},
	{Key: "illumos", Title: "Illumos", Description: "Builds the application for Illumos"},
	{Key: "freebsd", Title: "FreeBSD", Description: "Builds the application for FreeBSD"},
	{Key: "netbsd", Title: "NetBSD", Description: "Builds the application for NetBSD"},
	{Key: "openbsd", Title: "OpenBSD", Description: "Builds the application for OpenBSD"},
	{Key: "plan9", Title: "Plan 9", Description: "Builds the application for Plan 9"},
	{Key: "solaris", Title: "Solaris", Description: "Builds the application for Solaris"},

	{Key: "homebrew", Title: "Homebrew", Description: "Publishes the builds to Homebrew"},
	{Key: "nfpms", Title: "NFPMS", Description: "Builds the application as RPMs, DEBs, and APKs for various Linux flavors"},
	{Key: "bom", Title: "BOM", Description: "Creates a bill of materials for each binary produced by the build"},
	{Key: "snapcraft", Title: "Snapcraft", Description: "Publishes the application as a Ubuntu Snap "},
}
View Source
var DefaultIcon = "code"
View Source
var Helpers = func() map[string][]string {
	ret := map[string][]string{}
	add := func(k string, v string) {
		ret[k] = []string{v}
	}

	add("key", "The key of your project, lowercase letters only")
	add("name", "The project name is displayed in many places")
	add("icon", "The key of the SVG image used for your project's favicon and app icon")
	add("exec", "Your application's executable name, defaults to key")
	add("version", "Semantic version of the project")
	add("package", "Full Golang package, like github.com/org/key")
	add("args", "Arguments for your project when launched")
	add("port", "The TCP port used by your project's HTTP server")
	add("modules", "Project Forge modules used by this project")
	add("ignore", "Files ignored by your project")
	add("tags", "Tags for your project, not really used anywhere yet")

	add("org", "The Github organization responsible for this project")
	add("authorID", "The GitHub handle of the author of this project")
	add("authorName", "The full name of the author of this project")
	add("authorEmail", "The email address of the author of this project")
	add("team", "The team that owns this project")
	add("license", "The software license used by this project")
	add("homepage", "The main web page for this project")
	add("sourcecode", "The URL of this project's source repository")
	add("summary", "A one-line summary of this project")
	add("description", "A full multi-line description of this project")
	add("ci", "When to run CI")
	add("homebrew", "Override the URL to download Homebrew assets from")
	add("bundle", "App bundle used in iOS and macOS applications")
	add("signingIdentity", "Keychain identity to use for signing binaries")
	add("notarizeEmail", "Email address used for Apple notarization, defaults to owner")
	add("databaseEngine", "Primary database engine, used for DDL and seed data")
	add("slack", "Slack webhook for notifying after successful releases")
	add("channels", "Various communication channels used by this project")
	add("javaPackage", "The Java package used by the Android application")
	add("goVersion", "The version used for Go, defaults to \""+DefaultGoVersion+"\"")
	add("goBinary", "The binary used for Go, defaults to \"go\"")
	add("configVars", "Configuration variables for code generation")
	add("extraFiles", "Additional files to include in the builds")
	add("deployments", "Files that track deployment of this app")
	add("envvars", "additional environment variables used by this project")
	add("docs", "documentation resources for this project")

	return ret
}()

Functions

This section is empty.

Types

type Build

type Build struct {
	Private   bool `json:"private,omitempty"`
	Changelog bool `json:"changelog,omitempty"`
	TestsFail bool `json:"testsFail,omitempty"`

	Desktop  bool `json:"desktop,omitempty"`
	Notarize bool `json:"notarize,omitempty"`
	Signing  bool `json:"signing,omitempty"`

	Simple bool `json:"simple,omitempty"`

	Android bool `json:"android,omitempty"`
	IOS     bool `json:"iOS,omitempty"`
	WASM    bool `json:"wasm,omitempty"`
	X86     bool `json:"x86,omitempty"`

	WindowsARM bool `json:"windowsARM,omitempty"`
	LinuxARM   bool `json:"linuxARM,omitempty"`
	LinuxMIPS  bool `json:"linuxMIPS,omitempty"`
	LinuxOdd   bool `json:"linuxOdd,omitempty"`

	AIX       bool `json:"aix,omitempty"`
	Dragonfly bool `json:"dragonfly,omitempty"`
	Illumos   bool `json:"illumos,omitempty"`
	FreeBSD   bool `json:"freeBSD,omitempty"`
	NetBSD    bool `json:"netBSD,omitempty"`
	OpenBSD   bool `json:"openBSD,omitempty"`
	Plan9     bool `json:"plan9,omitempty"`
	Solaris   bool `json:"solaris,omitempty"`

	Homebrew  bool `json:"homebrew,omitempty"`
	NFPMS     bool `json:"nfpms,omitempty"`
	BOM       bool `json:"bom,omitempty"`
	Snapcraft bool `json:"snapcraft,omitempty"`
}

func BuildFromMap

func BuildFromMap(frm util.ValueMap) *Build

func (*Build) Empty

func (b *Build) Empty() bool

func (*Build) HasArm

func (b *Build) HasArm() bool

func (*Build) Mobile

func (b *Build) Mobile() bool

func (*Build) ToMap

func (b *Build) ToMap() map[string]bool

type BuildOption

type BuildOption struct {
	Key         string
	Title       string
	Description string
}

type Doc added in v0.7.16

type Doc struct {
	Name     string `json:"name"`
	Provider string `json:"provider,omitempty"`
	URL      string `json:"url"`
}

type Docs added in v0.7.16

type Docs []*Doc

type Info

type Info struct {
	Org             string            `json:"org,omitempty"`
	AuthorID        string            `json:"authorID,omitempty"`
	AuthorName      string            `json:"authorName,omitempty"`
	AuthorEmail     string            `json:"authorEmail,omitempty"`
	Team            string            `json:"team,omitempty"`
	License         string            `json:"license,omitempty"`
	Homepage        string            `json:"homepage,omitempty"`
	Sourcecode      string            `json:"sourcecode,omitempty"`
	Summary         string            `json:"summary,omitempty"`
	Description     string            `json:"description,omitempty"`
	CI              string            `json:"ci,omitempty"`
	Homebrew        string            `json:"homebrew,omitempty"`
	Bundle          string            `json:"bundle,omitempty"`
	SigningIdentity string            `json:"signingIdentity,omitempty"`
	NotarizeEmail   string            `json:"notarizeEmail,omitempty"`
	DatabaseEngine  string            `json:"databaseEngine,omitempty"`
	Slack           string            `json:"slack,omitempty"`
	Channels        []string          `json:"channels,omitempty"`
	JavaPackage     string            `json:"javaPackage,omitempty"`
	GoVersion       string            `json:"goVersion,omitempty"`
	GoBinary        string            `json:"goBinary,omitempty"`
	ConfigVars      util.KeyTypeDescs `json:"configVars,omitempty"`
	ExtraFiles      []string          `json:"extraFiles,omitempty"`
	Deployments     []string          `json:"deployments,omitempty"`
	EnvVars         []string          `json:"envVars,omitempty"`
	Docs            Docs              `json:"docs,omitempty"`
	ModuleDefs      ModuleDefs        `json:"moduleDefs,omitempty"`
}

func (*Info) AuthorIDSafe

func (i *Info) AuthorIDSafe() string

func (*Info) NotarizationEmail added in v0.10.35

func (i *Info) NotarizationEmail() string

func (*Info) SigningIdentityTrimmed

func (i *Info) SigningIdentityTrimmed() string

type ModuleDef

type ModuleDef struct {
	Key  string `json:"key"`
	Path string `json:"path"`
	URL  string `json:"url"`
}

type ModuleDefs

type ModuleDefs []*ModuleDef

type Project

type Project struct {
	Key     string   `json:"key"`
	Name    string   `json:"name,omitempty"`
	Icon    string   `json:"icon,omitempty"`
	Exec    string   `json:"exec,omitempty"`
	Version string   `json:"version"`
	Package string   `json:"package,omitempty"`
	Args    string   `json:"args,omitempty"`
	Port    int      `json:"port,omitempty"`
	Modules []string `json:"modules"`
	Ignore  []string `json:"ignore,omitempty"`
	Tags    []string `json:"tags"`

	Info  *Info        `json:"info,omitempty"`
	Theme *theme.Theme `json:"theme,omitempty"`
	Build *Build       `json:"build,omitempty"`

	ExportArgs *model.Args   `json:"-"`
	Config     util.ValueMap `json:"-"`
	Path       string        `json:"-"`
	Parent     string        `json:"-"`
	Error      string        `json:"error,omitempty"`
}

func NewProject

func NewProject(key string, path string) *Project

func (*Project) CleanKey

func (p *Project) CleanKey() string

func (*Project) DatabaseEngineDefault added in v0.11.28

func (p *Project) DatabaseEngineDefault() string

func (*Project) DatabaseEngines added in v0.11.28

func (p *Project) DatabaseEngines() []string

func (*Project) DescriptionSafe

func (p *Project) DescriptionSafe() string

func (*Project) Executable

func (p *Project) Executable() string

func (*Project) GoVersion added in v0.11.22

func (p *Project) GoVersion() string

func (*Project) HasModule

func (p *Project) HasModule(key string) bool

func (*Project) IconSafe

func (p *Project) IconSafe() string

func (*Project) ModuleArgExport added in v0.3.11

func (p *Project) ModuleArgExport(pSvc *Service, logger util.Logger) (*model.Args, error)

func (*Project) NameSafe added in v0.6.9

func (p *Project) NameSafe() string

func (*Project) Title

func (p *Project) Title() string

func (*Project) ToMap

func (p *Project) ToMap() util.ValueMap

func (*Project) ToTemplateContext

func (p *Project) ToTemplateContext(configVars util.KeyTypeDescs, portOffsets map[string]int, linebreak string) *TemplateContext

func (*Project) WebPath

func (p *Project) WebPath() string

type Projects

type Projects []*Project

func (Projects) AllModules

func (p Projects) AllModules() []string

func (Projects) Get added in v0.2.33

func (p Projects) Get(key string) *Project

func (Projects) Keys added in v0.3.1

func (p Projects) Keys() []string

func (Projects) Root

func (p Projects) Root() *Project

func (Projects) Tags added in v0.3.1

func (p Projects) Tags() []string

func (Projects) Titles added in v0.3.1

func (p Projects) Titles() []string

func (Projects) WithTags added in v0.3.1

func (p Projects) WithTags(tags ...string) Projects

func (Projects) WithoutTags added in v0.3.15

func (p Projects) WithoutTags(tags ...string) Projects

type Service

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

func NewService

func NewService() *Service

func (*Service) ByPath

func (s *Service) ByPath(path string) *Project

func (*Service) Default added in v0.10.17

func (s *Service) Default() *Project

func (*Service) DeleteExportEnum added in v0.6.14

func (s *Service) DeleteExportEnum(fs filesystem.FileLoader, e string, logger util.Logger) error

func (*Service) DeleteExportModel added in v0.3.12

func (s *Service) DeleteExportModel(fs filesystem.FileLoader, mdl string, logger util.Logger) error

func (*Service) Get

func (s *Service) Get(key string) (*Project, error)

func (*Service) GetFile added in v0.7.21

func (s *Service) GetFile(key string) json.RawMessage

func (*Service) GetFilesystem

func (s *Service) GetFilesystem(prj *Project) (filesystem.FileLoader, error)

func (*Service) Keys

func (s *Service) Keys() []string

func (*Service) Projects

func (s *Service) Projects() Projects

func (*Service) Refresh

func (s *Service) Refresh(logger util.Logger) (Projects, error)

func (*Service) Save

func (s *Service) Save(prj *Project, logger util.Logger) error

func (*Service) SaveExportEnum added in v0.6.14

func (s *Service) SaveExportEnum(fs filesystem.FileLoader, e *enum.Enum) error

func (*Service) SaveExportGroups added in v0.4.0

func (s *Service) SaveExportGroups(fs filesystem.FileLoader, g model.Groups) error

func (*Service) SaveExportModel added in v0.3.12

func (s *Service) SaveExportModel(fs filesystem.FileLoader, mdl *model.Model) error

func (*Service) Search

func (s *Service) Search(q string) (result.Results, error)

type TemplateContext

type TemplateContext struct {
	Key         string            `json:"key"`
	Name        string            `json:"name,omitempty"`
	Exec        string            `json:"exec,omitempty"`
	Version     string            `json:"version"`
	Package     string            `json:"package,omitempty"`
	Args        string            `json:"args,omitempty"`
	Port        int               `json:"port,omitempty"`
	ConfigVars  util.KeyTypeDescs `json:"configVars,omitempty"`
	PortOffsets map[string]int    `json:"portOffsets,omitempty"`

	Ignore     []string `json:"ignore,omitempty"`
	IgnoreGrep string   `json:"ignoreGrep,omitempty"`
	Modules    []string `json:"modules,omitempty"`
	Tags       []string `json:"tags,omitempty"`

	ExportArgs     *model.Args   `json:"exportArgs,omitempty"`
	Config         util.ValueMap `json:"config,omitempty"`
	Info           *Info         `json:"info,omitempty"`
	Build          *Build        `json:"build,omitempty"`
	Theme          *theme.Theme  `json:"theme,omitempty"`
	DatabaseEngine string        `json:"databaseEngine,omitempty"`
	Linebreak      string        `json:"-"`
}

func (*TemplateContext) BuildAndroid

func (t *TemplateContext) BuildAndroid() bool

func (*TemplateContext) BuildDesktop added in v0.11.11

func (t *TemplateContext) BuildDesktop() bool

func (*TemplateContext) BuildIOS

func (t *TemplateContext) BuildIOS() bool

func (*TemplateContext) BuildMobile added in v0.2.25

func (t *TemplateContext) BuildMobile() bool

func (*TemplateContext) BuildNotarize added in v0.11.11

func (t *TemplateContext) BuildNotarize() bool

func (*TemplateContext) BuildWASM added in v0.11.14

func (t *TemplateContext) BuildWASM() bool

func (*TemplateContext) CIContent

func (t *TemplateContext) CIContent() string

func (*TemplateContext) CleanKey

func (t *TemplateContext) CleanKey() string

func (*TemplateContext) ConfigVarsContent added in v0.2.9

func (t *TemplateContext) ConfigVarsContent() string

func (*TemplateContext) DatabaseUIOpts added in v0.2.21

func (t *TemplateContext) DatabaseUIOpts() (bool, bool, bool)

func (*TemplateContext) DatabaseUIReadOnly added in v0.2.21

func (t *TemplateContext) DatabaseUIReadOnly() bool

func (*TemplateContext) DatabaseUISQLEditor added in v0.2.21

func (t *TemplateContext) DatabaseUISQLEditor() bool

func (*TemplateContext) DatabaseUISaveUser added in v0.9.13

func (t *TemplateContext) DatabaseUISaveUser() bool

func (*TemplateContext) ExplainPrefix added in v0.2.37

func (t *TemplateContext) ExplainPrefix() string

func (*TemplateContext) ExtraFilesContent

func (t *TemplateContext) ExtraFilesContent() string

func (*TemplateContext) ExtraFilesDocker

func (t *TemplateContext) ExtraFilesDocker() string

func (*TemplateContext) GoBinaryContent

func (t *TemplateContext) GoBinaryContent() string

func (*TemplateContext) GoBinarySafe

func (t *TemplateContext) GoBinarySafe() string

func (*TemplateContext) GoVersionSafe

func (t *TemplateContext) GoVersionSafe() string

func (*TemplateContext) HasAccount added in v0.12.2

func (t *TemplateContext) HasAccount() bool

func (*TemplateContext) HasDatabaseModule added in v0.2.15

func (t *TemplateContext) HasDatabaseModule() bool

func (*TemplateContext) HasModule

func (t *TemplateContext) HasModule(key string) bool

func (*TemplateContext) HasModules added in v0.11.28

func (t *TemplateContext) HasModules(keys ...string) bool

func (*TemplateContext) HasSlack

func (t *TemplateContext) HasSlack() bool

func (*TemplateContext) HasUser added in v0.11.15

func (t *TemplateContext) HasUser() bool

func (*TemplateContext) IgnoredQuoted

func (t *TemplateContext) IgnoredQuoted() string

func (*TemplateContext) IgnoredSetting

func (t *TemplateContext) IgnoredSetting() string

func (*TemplateContext) IsArmAndMips added in v0.11.12

func (t *TemplateContext) IsArmAndMips() bool

func (*TemplateContext) IsNotarized added in v0.10.34

func (t *TemplateContext) IsNotarized() bool

func (*TemplateContext) KeyProper

func (t *TemplateContext) KeyProper() string

func (*TemplateContext) ModuleMarkdown

func (t *TemplateContext) ModuleMarkdown() string

func (*TemplateContext) NameCompressed

func (t *TemplateContext) NameCompressed() string

func (*TemplateContext) Placeholder added in v0.9.6

func (t *TemplateContext) Placeholder(idx int) string

func (*TemplateContext) PortIncremented

func (t *TemplateContext) PortIncremented(i int) int

func (*TemplateContext) SQLServer added in v0.9.6

func (t *TemplateContext) SQLServer() bool

func (*TemplateContext) SourceTrimmed

func (t *TemplateContext) SourceTrimmed() string

func (*TemplateContext) Title

func (t *TemplateContext) Title() string

func (*TemplateContext) TypeUUID added in v0.11.28

func (t *TemplateContext) TypeUUID() string

func (*TemplateContext) UsesLib

func (t *TemplateContext) UsesLib() bool

type ValidationError added in v0.2.38

type ValidationError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

func Validate added in v0.2.38

func Validate(p *Project, fs filesystem.FileLoader, moduleDeps map[string][]string) []*ValidationError

Jump to

Keyboard shortcuts

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