diff options
| author | jet2tlf <jet2tlf@gmail.com> | 2024-06-03 16:48:36 +0000 |
|---|---|---|
| committer | jet2tlf <jet2tlf@gmail.com> | 2024-06-03 16:48:36 +0000 |
| commit | b3dd001bc8cc282c75105ba229e0c55e5a4b3252 (patch) | |
| tree | 1351303952ba7ee16a494db4c069d38747bf3528 /app/status.go | |
| parent | 8a94110728cca144388958d4bd322045f8bfb9e4 (diff) | |
| download | http-server-go-b3dd001bc8cc282c75105ba229e0c55e5a4b3252.tar.gz http-server-go-b3dd001bc8cc282c75105ba229e0c55e5a4b3252.zip | |
codecrafters submit [skip ci]
Diffstat (limited to 'app/status.go')
| -rw-r--r-- | app/status.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/status.go b/app/status.go new file mode 100644 index 0000000..6a905c9 --- /dev/null +++ b/app/status.go @@ -0,0 +1,24 @@ +package main + +type status struct { + code int + text string +} + +type Status interface { + Code() int + Text() string +} + +var ( + Ok Status = &status{200, "OK"} + NotFound Status = &status{404, "Not Found"} +) + +func (s *status) Code() int { + return s.code +} + +func (s *status) Text() string { + return s.text +} |