1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

(#1554) Add support for all common compressions (write and read)

- Remove the context.Context interface and export the *context, the iris.Context now points to the pointer\nSupport compression and rate limiting in the FileServer\nBit of code organisation


Former-commit-id: ad1c61bf968059510c6be9e7f2cceec7da70ba17
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-07-10 23:21:09 +03:00
parent 645da2b2ef
commit 0f113dfcda
112 changed files with 2119 additions and 3390 deletions

View File

@@ -73,7 +73,7 @@ func (p Problem) getURI(key string) string {
}
// Updates "type" field to absolute URI, recursively.
func (p Problem) updateURIsToAbs(ctx Context) {
func (p Problem) updateURIsToAbs(ctx *Context) {
if p == nil {
return
}
@@ -271,7 +271,7 @@ type ProblemOptions struct {
// Should return time.Time, time.Duration, int64, int, float64 or string.
//
// Overrides the RetryAfter field.
RetryAfterFunc func(Context) interface{}
RetryAfterFunc func(*Context) interface{}
}
func parseDurationToSeconds(dur time.Duration) int64 {
@@ -310,7 +310,7 @@ func (o *ProblemOptions) parseRetryAfter(value interface{}, timeLayout string) s
}
// Apply accepts a Context and applies specific response-time options.
func (o *ProblemOptions) Apply(ctx Context) {
func (o *ProblemOptions) Apply(ctx *Context) {
retryAfterHeaderValue := ""
timeLayout := ctx.Application().ConfigurationReadOnly().GetTimeFormat()