summaryrefslogtreecommitdiff
path: root/src/main.go
blob: e61dfb5f7aba3290488ab729ebc356a994bcaaa4 (plain)
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
// vim: shiftwidth=4 tabstop=4 noexpandtab

package main

import (
	"log"
)

var (
	config RuntimeConfig
	camera Camera
)

func main() {

	// disable log timestamp because systemd takes care of that
	log.SetFlags(0)

	// parse flags and read config
	config = GetRuntimeConfig()

	// print startup message
	log.Println("Starting birdscan")

	// create camera
	camera = NewCamera()

	// start goroutines
	server := NewWebServer()
	go server.run()  // http server / user interface

	// run camera
	camera.run()
}