project

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDir = "." + util.AppKey
)

Variables

View Source
var AllBuildOptions = []*BuildOption{
	{Key: "publish", Title: "Publish", Description: "The release process will publish a full release"},
	{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"},
	{Key: "notarize", Title: "Notarize", Description: "Sends build artifacts to Apple for notarization"},
	{Key: "signing", Title: "Signing", Description: "Signs the checksums using gpg"},

	{Key: "simple", Title: "Simple", Description: "Only build Linux amd64 and a single Docker image"},

	{Key: "android", Title: "Android", Description: "Builds the application as an Android library and webview-based APK"},
	{Key: "ios", Title: "iOS", Description: "Builds the application as an iOS framework and webview-based app"},
	{Key: "wasm", Title: "WASM", Description: "Builds the application for WebAssembly"},
	{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: "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("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("slack", "Slack webhook for notifying after successful releases")
	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")

	return ret
}()

Functions

This section is empty.

Types

type Build

type Build struct {
	Publish   bool `json:"publish,omitempty"`
	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"`

	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 Info

type Info struct {
	Org             string            `json:"org,omitempty"`
	AuthorID        string            `json:"authorID,omitempty"`
	AuthorName      string            `json:"authorName,omitempty"`
	AuthorEmail     string            `json:"authorEmail,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"`
	Slack           string            `json:"slack,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"`
	ModuleDefs      ModuleDefs        `json:"moduleDefs,omitempty"`
}

func (*Info) AuthorIDSafe

func (i *Info) AuthorIDSafe() 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:"-"`
}

func NewProject

func NewProject(key string, path string) *Project

func (*Project) CleanKey

func (p *Project) CleanKey() string

func (*Project) DescriptionSafe

func (p *Project) DescriptionSafe() string

func (*Project) Executable

func (p *Project) Executable() 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) *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) 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) GetFilesystem

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

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, logger util.Logger) error

func (*Service) SaveExportGroups added in v0.4.0

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

func (*Service) SaveExportModel added in v0.3.12

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

func (*Service) Search

func (s *Service) Search(ctx context.Context, q string, logger util.Logger) (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"`
}

func (*TemplateContext) BuildAndroid

func (t *TemplateContext) BuildAndroid() bool

func (*TemplateContext) BuildIOS

func (t *TemplateContext) BuildIOS() bool

func (*TemplateContext) BuildMobile added in v0.2.25

func (t *TemplateContext) BuildMobile() 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)

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) 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) HasDatabaseModule added in v0.2.15

func (t *TemplateContext) HasDatabaseModule() bool

func (*TemplateContext) HasModule

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

func (*TemplateContext) HasSlack

func (t *TemplateContext) HasSlack() bool

func (*TemplateContext) IgnoredQuoted

func (t *TemplateContext) IgnoredQuoted() string

func (*TemplateContext) IgnoredSetting

func (t *TemplateContext) IgnoredSetting() string

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) PortIncremented

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

func (*TemplateContext) SourceTrimmed

func (t *TemplateContext) SourceTrimmed() string

func (*TemplateContext) Title

func (t *TemplateContext) Title() 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, moduleDeps map[string][]string, fs filesystem.FileLoader) []*ValidationError

Jump to

Keyboard shortcuts

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