config

package
v0.0.0-...-0c63773 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package config

Program can get Opts from:

  1. Command line flags
  2. config.ini Types of lines: * # - comment * some option=value of the option

Index

Constants

This section is empty.

Variables

View Source
var Opts struct {
	// Port for website (with ':')
	Port string `default:":500" name:"port" comment:"Port for website"`
	// Debug mode
	Debug bool `default:"false" name:"debug"`
	// Offset - number of records on single screen
	Offset int `default:"100" name:"offset" comment:"number of records on a single screen"`
	// CheckVer - should the program check check is there a new version
	CheckVer bool `default:"true" name:"should_check_version"`
	// OpenBrowser - should the program open a browser automatically
	OpenBrowser bool `default:"true" name:"open_browser"`
	// NeatWindow - should the program open the special neat window
	NeatWindow bool `default:"true" name:"open_neat_window" comment:"has effect only if 'open browser' is true"`
}

Opts keeps vars for global use

Tags: * default - default value * name - name in the file config.ini * comment - comment in the file config.ini

Functions

func ParseConfig

func ParseConfig() (err error)

ParseConfig parses flags like -port, -debug, -offset and etc. If there's no any flags, it tries to parse config file "config.ini"

Types

This section is empty.

Jump to

Keyboard shortcuts

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