config

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package config contains the configuration structs for the GoKi tool.

Index

Constants

This section is empty.

Variables

View Source
var SupportedArch = map[string]bool{
	"386":         true,
	"amd64":       true,
	"amd64p32":    true,
	"arm":         true,
	"armbe":       true,
	"arm64":       true,
	"arm64be":     true,
	"loong64":     false,
	"mips":        false,
	"mipsle":      false,
	"mips64":      false,
	"mips64le":    false,
	"mips64p32":   false,
	"mips64p32le": false,
	"ppc":         false,
	"ppc64":       false,
	"ppc64le":     false,
	"riscv":       false,
	"riscv64":     false,
	"s390":        false,
	"s390x":       false,
	"sparc":       false,
	"sparc64":     false,
	"wasm":        false,
}

SupportedArch is a map containing all computer architectures and whether they are supported by GoKi.

View Source
var SupportedOS = map[string]bool{
	"aix":       false,
	"android":   true,
	"darwin":    true,
	"dragonfly": false,
	"freebsd":   false,
	"hurd":      false,
	"illumos":   false,
	"ios":       true,
	"js":        false,
	"linux":     true,
	"nacl":      false,
	"netbsd":    false,
	"openbsd":   false,
	"plan9":     false,
	"solaris":   false,
	"wasip1":    false,
	"windows":   true,
	"zos":       false,
}

SupportedOS is a map containing all operating systems and whether they are supported by GoKi.

Functions

func ArchSupported

func ArchSupported(arch string) error

ArchSupported determines whether the given architecture is supported by GoKi. If it is, it returns nil. If it isn't, it also returns an error detailing the issue with the architecture (not found or not supported).

func OSSupported

func OSSupported(os string) error

OSSupported determines whether the given operating system is supported by GoKi. If it is, it returns nil. If it isn't, it returns an error detailing the issue with the operating system (not found or not supported).

Types

type Build

type Build struct {

	// [def: .] the path of the package to build
	Package string `def:"." desc:"the path of the package to build"`

	// the target platforms to build executables for
	Platform []Platform `desc:"the target platforms to build executables for"`
}

Build contains the configuration options for the build command.

type Colorgen

type Colorgen struct {

	// [def: colors.xml] the source file path to generate the color schemes from
	Source string `def:"colors.xml" desc:"the source file path to generate the color schemes from"`

	// [def: colorgen.go] the output file to store the resulting Go file in
	Output string `def:"colorgen.go" desc:"the output file to store the resulting Go file in"`

	// [def: main] the package in which the color schemes will be used
	Package string `def:"main" nest:"+" desc:"the package in which the color schemes will be used"`

	// the comment for the color schemes variable
	Comment string `desc:"the comment for the color schemes variable"`
}

Colorgen contains the configuration options for the colorgen command.

type Config

type Config struct {

	// the name of the project
	Name string `desc:"the name of the project"`

	// the description of the project
	Desc string `desc:"the description of the project"`

	// [def: v0.0.0] the version of the project
	Version string `def:"v0.0.0" desc:"the version of the project"`

	// the type of the project (app/library)
	Type Types `desc:"the type of the project (app/library)"`

	// the configuration options for the build command
	Build Build `desc:"the configuration options for the build command"`

	// the configuration options for the colorgen command
	Colorgen Colorgen `desc:"the configuration options for the colorgen command"`

	// the configuration options for the install command
	Install Install `desc:"the configuration options for the install command"`

	// the configuration options for the log command
	Log Log `desc:"the configuration options for the log command"`

	// the configuration options for the release command
	Release Release `desc:"the configuration options for the release command"`
}

Config is the main config struct that contains all of the configuration options for the GoKi tool

type Install

type Install struct {

	// [def: .] the name/path of the package to install
	Package string `def:"." nest:"+" desc:"the name/path of the package to install"`

	// the target platforms to install the executables on, as a list of operating systems (this should include no more than the operating system you are on, android, and ios)
	Target []string `` /* 174-byte string literal not displayed */
}

Install contains the configuration options for the install command.

type Log

type Log struct {

	// [def: android] the target platform to view the logs for (ios or android)
	Target string `def:"android" nest:"+" desc:"the target platform to view the logs for (ios or android)"`

	// [def: false] whether to keep the previous log messages or clear them
	Keep bool `def:"false" desc:"whether to keep the previous log messages or clear them"`

	// [def: F] messages not generated from your app equal to or above this log level will be shown
	All string `def:"F" desc:"messages not generated from your app equal to or above this log level will be shown"`
}

Log contains the configuration options for the log command.

type Platform

type Platform struct {
	OS   string
	Arch string
}

Platform is a platform with an operating system and an architecture

func ParsePlatform

func ParsePlatform(platform string) (Platform, error)

ParsePlatform parses the given platform string of format os[/arch]

type Release

type Release struct {

	// [def: version.go] the Go file to store version information in
	VersionFile string `def:"version.go" desc:"the Go file to store version information in"`

	// [def: main] the Go package in which the version file will be stored
	Package string `def:"main" nest:"+" desc:"the Go package in which the version file will be stored"`
}

type Types

type Types int //enums:enum

Types is an enum with all of the possible types of packages.

const (
	// TypeApp is an executable app
	TypeApp Types = iota
	// TypeLibrary is an importable library
	TypeLibrary
)
const TypesN Types = 2

TypesN is the total number of enum values for type Types.

func TypesValues

func TypesValues() []Types

TypesValues returns all possible values of the type Types. This slice will be in the same order as those returned by the Values, Strings, and Descs methods on Types.

func (Types) Desc

func (i Types) Desc() string

Desc returns the description of the Types value.

func (Types) Descs

func (i Types) Descs() []string

Descs returns the descriptions of all possible values of type Types. This slice will be in the same order as those returned by Values and Strings.

func (Types) Int64

func (i Types) Int64() int64

Int64 returns the Types value as an int64.

func (Types) IsValid

func (i Types) IsValid() bool

IsValid returns whether the value is a valid option for type Types.

func (Types) MarshalText

func (i Types) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*Types) SetInt64

func (i *Types) SetInt64(in int64)

SetInt64 sets the Types value from an int64.

func (*Types) SetString

func (i *Types) SetString(s string) error

SetString sets the Types value from its string representation, and returns an error if the string is invalid.

func (Types) String

func (i Types) String() string

String returns the string representation of this Types value.

func (Types) Strings

func (i Types) Strings() []string

Strings returns the string representations of all possible values of type Types. This slice will be in the same order as those returned by Values and Descs.

func (*Types) UnmarshalText

func (i *Types) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (Types) Values

func (i Types) Values() []enums.Enum

Values returns all possible values of type Types. This slice will be in the same order as those returned by Strings and Descs.

Jump to

Keyboard shortcuts

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