mirror of
https://github.com/willnorris/imageproxy.git
synced 2024-12-16 21:56:43 -05:00
add -version flag and goxc build config
This commit is contained in:
parent
405faae777
commit
26dde07ec0
3 changed files with 23 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
build
|
||||
.goxc.local.json
|
||||
*.test
|
||||
|
|
6
.goxc.json
Normal file
6
.goxc.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"ConfigVersion": "0.9",
|
||||
"ArtifactsDest": "build",
|
||||
"PackageVersion": "0.1",
|
||||
"PrereleaseInfo": "snapshot"
|
||||
}
|
|
@ -26,14 +26,28 @@ import (
|
|||
"github.com/willnorris/go-imageproxy/proxy"
|
||||
)
|
||||
|
||||
// goxc values
|
||||
var (
|
||||
// VERSION is the version string for go-imageproxy.
|
||||
VERSION string
|
||||
// BUILD_DATE is the timestamp of when go-imageproxy was built.
|
||||
BUILD_DATE string
|
||||
)
|
||||
|
||||
var addr = flag.String("addr", "localhost:8080", "TCP address to listen on")
|
||||
var whitelist = flag.String("whitelist", "", "comma separated list of allowed remote hosts")
|
||||
var cacheDir = flag.String("cacheDir", "", "directory to use for file cache")
|
||||
var version = flag.Bool("version", false, "print version information")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
fmt.Printf("go-imageproxy listening on %s\n", *addr)
|
||||
if *version {
|
||||
fmt.Printf("%v\nBuild: %v\n", VERSION, BUILD_DATE)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf("go-imageproxy (version %v) listening on %s\n", VERSION, *addr)
|
||||
|
||||
var c httpcache.Cache
|
||||
if *cacheDir != "" {
|
||||
|
|
Loading…
Reference in a new issue