Documentation ¶
Index ¶
- Constants
- Variables
- type Build
- type BuildOption
- type Info
- type ModuleDef
- type ModuleDefs
- type Project
- func (p *Project) CleanKey() string
- func (p *Project) DescriptionSafe() string
- func (p *Project) Executable() string
- func (p *Project) HasModule(key string) bool
- func (p *Project) IconSafe() string
- func (p *Project) Title() string
- func (p *Project) ToMap() util.ValueMap
- func (p *Project) ToTemplateContext(configVars util.KeyTypeDescs, portOffsets map[string]int) *TemplateContext
- func (p *Project) WebPath() string
- type Projects
- type Service
- func (s *Service) ByPath(path string) *Project
- func (s *Service) Get(key string) (*Project, error)
- func (s *Service) GetFilesystem(prj *Project) filesystem.FileLoader
- func (s *Service) Init() error
- func (s *Service) Keys() []string
- func (s *Service) Projects() Projects
- func (s *Service) Refresh() (Projects, error)
- func (s *Service) Save(prj *Project) error
- func (s *Service) Search(ctx context.Context, q string, logger *zap.SugaredLogger) (result.Results, error)
- type TemplateContext
- func (t *TemplateContext) BuildAndroid() bool
- func (t *TemplateContext) BuildIOS() bool
- func (t *TemplateContext) CIContent() string
- func (t *TemplateContext) CleanKey() string
- func (t *TemplateContext) ConfigVarsContent() string
- func (t *TemplateContext) ExtraFilesContent() string
- func (t *TemplateContext) ExtraFilesDocker() string
- func (t *TemplateContext) GoBinaryContent() string
- func (t *TemplateContext) GoBinarySafe() string
- func (t *TemplateContext) GoVersionSafe() string
- func (t *TemplateContext) HasModule(m string) bool
- func (t *TemplateContext) HasSlack() bool
- func (t *TemplateContext) IgnoredQuoted() string
- func (t *TemplateContext) IgnoredSetting() string
- func (t *TemplateContext) KeyProper() string
- func (t *TemplateContext) ModuleMarkdown() string
- func (t *TemplateContext) NameCompressed() string
- func (t *TemplateContext) PortIncremented(i int) int
- func (t *TemplateContext) SourceTrimmed() string
- func (t *TemplateContext) Title() string
- func (t *TemplateContext) UsesLib() bool
Constants ¶
View Source
const (
ConfigFilename = ".projectforge.json"
)
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: "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("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("moduleArgs", "Arguments for custom modules") 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"` Snapcraft bool `json:"snapcraft,omitempty"` }
func BuildFromMap ¶
type BuildOption ¶
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"` ModuleDefs ModuleDefs `json:"moduleDefs,omitempty"` ModuleArgs util.ValueMap `json:"moduleArgs,omitempty"` }
func (*Info) AuthorIDSafe ¶
func (*Info) SigningIdentityTrimmed ¶
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"` Info *Info `json:"info,omitempty"` Theme *theme.Theme `json:"theme,omitempty"` Build *Build `json:"build,omitempty"` Path string `json:"-"` Parent string `json:"-"` }
func NewProject ¶
func (*Project) DescriptionSafe ¶
func (*Project) Executable ¶
func (*Project) ToTemplateContext ¶
func (p *Project) ToTemplateContext(configVars util.KeyTypeDescs, portOffsets map[string]int) *TemplateContext
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(logger *zap.SugaredLogger) *Service
func (*Service) GetFilesystem ¶
func (s *Service) GetFilesystem(prj *Project) filesystem.FileLoader
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"` Modules []string `json:"modules,omitempty"` Info *Info `json:"info,omitempty"` Build *Build `json:"build,omitempty"` Theme *theme.Theme `json:"theme,omitempty"` Ignore []string `json:"ignore,omitempty"` IgnoreGrep string `json:"ignoreGrep,omitempty"` }
func (*TemplateContext) BuildAndroid ¶
func (t *TemplateContext) BuildAndroid() bool
func (*TemplateContext) BuildIOS ¶
func (t *TemplateContext) BuildIOS() 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) 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) 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
Click to show internal directories.
Click to hide internal directories.