-
Notifications
You must be signed in to change notification settings - Fork 19
/
const.go
34 lines (28 loc) · 882 Bytes
/
const.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
package main
import (
"errors"
)
var (
Version = "v0"
RequestIdCtxKey = &contextKey{"RequestId"}
)
const (
Prog = "registry"
Description = "is a local chain registry api that exposes chain registry based on configs"
envPrefix = "REGISTRY_"
)
// Define default errors
var (
ErrValidation = errors.New("validation error")
ErrNotFound = errors.New("resource not found")
ErrNotImplemented = errors.New("not Implemented")
ErrMethodNotAllowed = errors.New("method not allowed")
ErrInternalServer = errors.New("internal server error")
)
// copied and modified from net/http/http.go
// contextKey is a value for use with context.WithValue. It's used as
// a pointer, so it fits in an interface{} without allocation.
type contextKey struct {
name string
}
func (k *contextKey) String() string { return Prog + " context value " + k.name }