helloworld

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Binary = "hello-world"

Binary is the app name.

Variables

This section is empty.

Functions

func Start

func Start() error

Start begins the application from a CLI. Parses flags, parses config and executes Run().

Types

type Config

type Config struct {
	Worlds int `json:"worlds" xml:"worlds" toml:"worlds" yaml:"worlds"`
	Hellos int `json:"hellos" xml:"hellos" toml:"hellos" yaml:"hellos"`
}

Config defines our applications's config file parameters.

type Flags

type Flags struct {
	VersionReq bool
	ConfigFile string
}

Flags defines our application's CLI arguments.

type HelloWorld

type HelloWorld struct {
	Flag *flag.FlagSet
	*Flags
	*Config
}

HelloWorld is the main application struct.

func (*HelloWorld) GetConfig

func (u *HelloWorld) GetConfig() error

GetConfig parses and returns our configuration data. Supports any format for config file: xml, yaml, json, toml.

func (*HelloWorld) ParseFlags

func (u *HelloWorld) ParseFlags(args []string)

ParseFlags runs the parser for CLI arguments.

func (*HelloWorld) Run

func (u *HelloWorld) Run() error

Run starts doing things.

Jump to

Keyboard shortcuts

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