Browse Source

stubbed out some basic functions

bmallred 9 years ago
parent
commit
f04e25f5de
1 changed files with 53 additions and 0 deletions
  1. 53 0
      main.go

+ 53 - 0
main.go

1
package main
2
3
import (
4
	"log"
5
	"net/http"
6
	"os"
7
	"time"
8
)
9
10
var (
11
	EnvironmentVariables = map[string]string{
12
		"LOOP_URL":  "localhost:6006",
13
		"LOOP_SALT": "whatyoutalkingaboutwillus",
14
		"LOOP_BASE": ".",
15
	}
16
)
17
18
func ConfigureEnvironment() {
19
	for key, value := range EnvironmentVariables {
20
		env := os.Getenv(key)
21
		if env == "" && value != "" {
22
			os.Setenv(key, value)
23
		}
24
	}
25
}
26
27
func main() {
28
	log.Print("Configuring environment...")
29
	ConfigureEnvironment()
30
31
	//http.HandleFunc("/", DefaultHandler)
32
33
	log.Fatal(http.ListenAndServe(address(), nil))
34
}
35
36
func address() string {
37
	return os.Getenv("LOOP_URL")
38
}
39
func validateCredentials(username, password, salt string) bool {
40
	return false
41
}
42
func createUser(username string) (string, error) {
43
	return "", nil
44
}
45
func createContent(username string) (string, error) {
46
	return "", nil
47
}
48
func addContent(content, filename string, file []byte) (string, error) {
49
	return "", nil
50
}
51
func publishContent(title, content string, date time.Time) (string, error) {
52
	return "", nil
53
}