Documentation ¶
Index ¶
- Constants
- func Aborted(format string, a ...any) error
- func AddUserver(_ http.ResponseWriter, r *http.Request) (proto.Message, error)
- func AlreadyExists(format string, a ...any) error
- func BadRequest(format string, a ...any) error
- func ContextMiddleware(h http.Handler) http.Handler
- func CorsMiddleware(h http.Handler) http.Handler
- func DeleteUserver(_ http.ResponseWriter, r *http.Request) (proto.Message, error)
- func GetUserContext(r *http.Request) string
- func HTTPStatusFromCode(code codes.Code) int
- func Internal(format string, a ...any) error
- func NewRouter(mws []mux.MiddlewareFunc) *mux.Router
- func NotFound(format string, a ...any) error
- func OutOfRange(format string, a ...any) error
- func PermissionDenied(format string, a ...any) error
- func RequestLogMiddleware(h http.Handler) http.Handler
- func RetrieveUserver(_ http.ResponseWriter, r *http.Request) (proto.Message, error)
- func RetrieveUservers(_ http.ResponseWriter, r *http.Request) (proto.Message, error)
- func Stats(_ http.ResponseWriter, r *http.Request) (proto.Message, error)
- func UnmarshalReq(r *http.Request, req proto.Message) error
- func Uptime(_ http.ResponseWriter, r *http.Request) (proto.Message, error)
- func WebSocketHandler(w http.ResponseWriter, r *http.Request)
- type Err
- type JSONHandlerFunc
- type JSONRouterMap
- type ProtoHandlerFunc
- type ProtobufRouterMap
- type Server
- type Transport
Constants ¶
View Source
const ( HeaderContentType = "Content-Type" MimeApplicationXProtobuf = "application/x-protobuf" MimeApplicationJSON = "application/json" )
View Source
const (
CtxKeyUser = "user"
)
Variables ¶
This section is empty.
Functions ¶
func Aborted ¶
Aborted indicates the operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc.
func AddUserver ¶
func AlreadyExists ¶
AlreadyExists means an attempt to create an entity failed because one already exists.
func BadRequest ¶
BadRequest indicates client specified an invalid argument.
func DeleteUserver ¶
func GetUserContext ¶
func HTTPStatusFromCode ¶
func Internal ¶
Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken.
func OutOfRange ¶
OutOfRange means operation was attempted past the valid range. E.g., seeking or reading past end of file.
func PermissionDenied ¶
PermissionDenied indicates the caller does not have permission to execute the specified operation.
func RetrieveUserver ¶
func RetrieveUservers ¶
func WebSocketHandler ¶
func WebSocketHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type JSONHandlerFunc ¶
func (JSONHandlerFunc) ServeHTTP ¶
func (fn JSONHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type JSONRouterMap ¶
type JSONRouterMap map[string]map[httpMethod]JSONHandlerFunc
type ProtoHandlerFunc ¶
func (ProtoHandlerFunc) ServeHTTP ¶
func (fn ProtoHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ProtobufRouterMap ¶
type ProtobufRouterMap map[string]map[httpMethod]ProtoHandlerFunc
Click to show internal directories.
Click to hide internal directories.