Documentation ¶
Index ¶
- func BadRequest(err error, w http.ResponseWriter)
- func GetLatestVersion(protos []*protobuf.Protobuf) (latest *protobuf.Protobuf)
- func GetName(r *http.Request) string
- func GetVersion(r *http.Request) string
- func GetVersionFromProtoSlice(protos []*protobuf.Protobuf, version string) (*protobuf.Protobuf, error)
- func NotFound(err error, w http.ResponseWriter)
- func ParseNameVersionExtString(in, ext string) (string, string)
- func ServeFile(w http.ResponseWriter, r *http.Request, name string, rdr io.ReadSeeker)
- func SortVersions(protos []*protobuf.Protobuf) (sorted []*protobuf.Protobuf)
- func UnmarshallInto(body io.Reader, obj interface{}) error
- func WriteJSONResponse(res interface{}, w http.ResponseWriter)
- func WriteRawResponse(out []byte, w http.ResponseWriter)
- type CatchAllHandler
- type ServerController
- type ServerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(err error, w http.ResponseWriter)
func GetLatestVersion ¶
func GetVersion ¶
func NotFound ¶
func NotFound(err error, w http.ResponseWriter)
func ServeFile ¶
func ServeFile(w http.ResponseWriter, r *http.Request, name string, rdr io.ReadSeeker)
func UnmarshallInto ¶
func WriteJSONResponse ¶
func WriteJSONResponse(res interface{}, w http.ResponseWriter)
func WriteRawResponse ¶
func WriteRawResponse(out []byte, w http.ResponseWriter)
Types ¶
type CatchAllHandler ¶
func NewCatchAllHandler ¶
func NewCatchAllHandler() *CatchAllHandler
func (*CatchAllHandler) ServeHTTP ¶
func (c *CatchAllHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ServerController ¶
type ServerController struct {
// contains filtered or unexported fields
}
func (*ServerController) DB ¶
func (s *ServerController) DB() dbcommon.DBEngine
func (*ServerController) SetDBEngine ¶
func (s *ServerController) SetDBEngine(db dbcommon.DBEngine)
func (*ServerController) SetStorageProvider ¶
func (s *ServerController) SetStorageProvider(storage storagecommon.Provider)
func (*ServerController) Storage ¶
func (s *ServerController) Storage() storagecommon.Provider
type ServerError ¶
type ServerError struct {
ErrMsg string `json:"error"`
}
func (*ServerError) Error ¶
func (e *ServerError) Error() string
func (*ServerError) JSON ¶
func (e *ServerError) JSON() string
Click to show internal directories.
Click to hide internal directories.