Documentation
¶
Index ¶
- Variables
- func BearerAuth(r *http.Request) (string, error)
- func GetHeaderInt(h http.Header, key string, defaultValue int) int
- func GzipMiddlware(next http.Handler) http.Handler
- func ReadBoolParam(qs url.Values, key string) bool
- func ReadCSV(qs url.Values, key string, defaulValue []string) []string
- func ReadInt(qs url.Values, key string, defaultValue int) int
- func ReadString(qs url.Values, key string, defaulValue string) string
- func ServeFile(w http.ResponseWriter, file File) error
- type File
- type GzipResponseWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidAuthHeader error = errors.New("invalid auth header")
)
Functions ¶
func GetHeaderInt ¶ added in v1.0.0
func ReadBoolParam ¶ added in v1.0.0
ReadBoolParam reads the key from the url query and returns true if the param is equal 'true' otherwise it returns false.
func ReadCSV ¶ added in v1.0.0
ReadCSV reads a comma seperated string from the given key and returns a slice of the values
func ReadString ¶ added in v1.0.0
Types ¶
type GzipResponseWriter ¶ added in v1.0.0
type GzipResponseWriter struct {
// contains filtered or unexported fields
}
func NewGzipResponseWriter ¶ added in v1.0.0
func NewGzipResponseWriter(w http.ResponseWriter) *GzipResponseWriter
func (*GzipResponseWriter) Flush ¶ added in v1.0.0
func (gw *GzipResponseWriter) Flush() error
func (*GzipResponseWriter) Header ¶ added in v1.0.0
func (gw *GzipResponseWriter) Header() http.Header
func (*GzipResponseWriter) Write ¶ added in v1.0.0
func (gw *GzipResponseWriter) Write(p []byte) (int, error)
func (*GzipResponseWriter) WriteHeader ¶ added in v1.0.0
func (gw *GzipResponseWriter) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.