-
Notifications
You must be signed in to change notification settings - Fork 1
/
mockserver_opt.go
39 lines (29 loc) · 1.38 KB
/
mockserver_opt.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
// import "github.com/caarlos0/env"
//////////////////////////////////////////////////////////////////////////
// Constant and data type/structure definitions
/*
Custom environment settings:
- **MS_ADDR**: Server address (string=":7070")
- **MS_COMPRESS**: Enable transparent response compression (bool)
- **MS_FILE**: Mock json file location (string="mock.json")
- **MS_PREFORK**: Boost performance by prefork (bool)
- **MS_RESTRICT**: Restriction level (default: relaxed) (int)
- **MS_VERBOSE**: Verbose mode (higher numbers increase the verbosity) (int="1")
*/
type envConfig struct {
Addr string `env:"MS_ADDR" envDefault:":7070"` // Server address
Compress bool `env:"MS_COMPRESS"` // Enable transparent response compression
File string `env:"MS_FILE" envDefault:"mock.json"` // Mock json file location
Prefork bool `env:"MS_PREFORK"` // Boost performance by prefork
Restrict int `env:"MS_RESTRICT"` // Restriction level (default: relaxed)
Verbose int `env:"MS_VERBOSE" envDefault:"1"` // Verbose mode (higher numbers increase the verbosity)
}
////////////////////////////////////////////////////////////////////////////
// Global variables definitions
// var (
// progname = "mockserver"
// version = "0.1.0"
// date = "2022-02-01"
// e envConfig
// )