Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Java ¶
type Java struct { }
func (Java) GetOutputFile ¶
func (Java) GetOutputFileName ¶
func (Java) IsFilenameValid ¶
func (Java) ParseSourceCodeLine ¶
type Kotlin ¶
type Kotlin struct { }
func (Kotlin) GetOutputFile ¶
func (Kotlin) GetOutputFileName ¶
func (Kotlin) IsFilenameValid ¶
func (Kotlin) ParseSourceCodeLine ¶
type Lang ¶
type Lang interface { GetInfo() LangInfo // given a filename, determine if it's a valid filename for your programming language. If given `name.xml`, return false for Typescript. `.tsx` or `.ts` return true for Typescript. IsFilenameValid(filename string) bool // Given 1 line of code of your language, parse that to get all of the environment variables in that line. Example: For Kotlin if the line is `val foo = Env.bar + Env.fooBar + Env.foo` return ["BAR", "FOO_BAR", "BAR"]. Don't worry about duplicates those are removed for you. ParseSourceCodeLine(line string) []string // Filename to save the output code in. Example: `Env.java` for Java. `env.ts` for Typescript. GetOutputFileName() string // Generate a multi-line string that is the output source code with all of the environment variables inside. It's recommended you view the existing languages supported by this code base for examples as there are a lot of steps in this function. GetOutputFile(values map[string]string, options types.GenerateOptions) string }
func GetAvailableLangs ¶
func GetAvailableLangs() []Lang
NL: Add your new language below to the list. If your new language struct is named "Typescript", for example, add `Typescript{}` to the end of this list below.
type LangInfo ¶
type LangInfo struct { // name of the language in lowercase and no spaces. If your programming language is Typescript, for example, return "typescript" Name string // Does your language require package names? (kotlin, java does) RequirePackageName bool }
Information about the programming language. This is used by the CLI code to generate the CLI commands but is also used by each language's code generation file. Let's say your programming language requires that you enter a package name or module name at the top of the source code file. Then, add that new struct property below.
Click to show internal directories.
Click to hide internal directories.