-
Notifications
You must be signed in to change notification settings - Fork 0
/
forest.go
37 lines (34 loc) · 1.2 KB
/
forest.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
// Copyright 2015 Afshin Darian. All rights reserved.
// Use of this source code is governed by The MIT License
// that can be found in the LICENSE file.
/*
Package forest provides a minimalist framework for writing REST services that
speak JSON.
*/
package forest
import "time"
const (
Body = "forestbody"
DurationCookie = 26 * time.Hour
DurationSession = 25 * time.Hour
ErrorBadCredentials = "bad credentials"
ErrorCSRF = SessionID + " required"
ErrorGeneric = "something went wrong"
ErrorMethodNotAllowed = "method not allowed"
ErrorNotFound = "not found"
ErrorParse = "json parse error"
ErrorUnauthorized = "unauthorized access"
Failure = false
Success = true
NoMessage = ""
SessionID = "sessionid"
SessionRefresh = "sessionrefresh"
SessionUser = "sessionuser"
SessionUserID = "sessionuserid"
Error = "foresterror"
SafeError = "forestsafeerror"
UnknownIP = "unknown-ip"
UnknownAgent = "unknown user agent"
UnknownSession = "unknown-session"
WareInstalled = "forest middleware"
)