aboutsummaryrefslogtreecommitdiff
path: root/app/status.go
blob: dccb5083b5bca377656db7c01b703948cdb1fa83 (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
package main

type status struct {
	code int
	text string
}

type Status interface {
	Code() int
	Text() string
}

var (
	Ok                  Status = &status{200, "OK"}
	Created             Status = &status{201, "Created"}
	NotFound            Status = &status{404, "Not Found"}
	InternalServerError Status = &status{500, "Internal Server Error"}
)

func (s *status) Code() int {
	return s.code
}

func (s *status) Text() string {
	return s.text
}