Add Generic interface

This commit is contained in:
Manuel de Brito Fontes 2016-11-16 15:24:26 -03:00
parent f2b627486d
commit 5a8e090736
36 changed files with 58014 additions and 675 deletions

View file

@ -23,10 +23,10 @@ import (
"os"
"regexp"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
)
const (
@ -59,10 +59,10 @@ var (
// BasicDigest returns authentication configuration for an Ingress rule
type BasicDigest struct {
Type string
Realm string
File string
Secured bool
Type string `json:"type"`
Realm string `json:"realm"`
File string `json:"file"`
Secured bool `json:"secured"`
}
// ParseAnnotations parses the annotations contained in the ingress

View file

@ -21,8 +21,9 @@ import (
"net/url"
"strings"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
)
const (
@ -34,9 +35,9 @@ const (
// External returns external authentication configuration for an Ingress rule
type External struct {
URL string
Method string
SendBody bool
URL string `json:"url"`
Method string `json:"method"`
SendBody bool `json:"sendBody"`
}
var (

View file

@ -19,10 +19,10 @@ package authtls
import (
"fmt"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/ingress/core/pkg/k8s"
"k8s.io/kubernetes/pkg/apis/extensions"
)
const (
@ -32,11 +32,11 @@ const (
// SSLCert returns external authentication configuration for an Ingress rule
type SSLCert struct {
Secret string
CertFileName string
KeyFileName string
CAFileName string
PemSHA string
Secret string `json:"secret"`
CertFileName string `json:"certFilename"`
KeyFileName string `json:"keyFilename"`
CAFileName string `json:"caFilename"`
PemSHA string `json:"pemSha"`
}
// ParseAnnotations parses the annotations contained in the ingress

View file

@ -17,9 +17,9 @@ limitations under the License.
package cors
import (
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
)
const (

View file

@ -31,8 +31,8 @@ const (
// Upstream returns the URL and method to use check the status of
// the upstream server/s
type Upstream struct {
MaxFails int
FailTimeout int
MaxFails int `json:"maxFails"`
FailTimeout int `json:"failTimeout"`
}
// ParseAnnotations parses the annotations contained in the ingress

View file

@ -20,11 +20,11 @@ import (
"errors"
"strings"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/ingress/core/pkg/ingress/defaults"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/util/net/sets"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/ingress/core/pkg/ingress/defaults"
)
const (
@ -39,7 +39,7 @@ var (
// SourceRange returns the CIDR
type SourceRange struct {
CIDR []string
CIDR []string `json:"cidr"`
}
// ParseAnnotations parses the annotations contained in the ingress

View file

@ -32,10 +32,10 @@ const (
// Configuration returns the proxy timeout to use in the upstream server/s
type Configuration struct {
ConnectTimeout int
SendTimeout int
ReadTimeout int
BufferSize string
ConnectTimeout int `json:"conectTimeout"`
SendTimeout int `json:"sendTimeout"`
ReadTimeout int `json:"readTimeout"`
BufferSize string `json:"bufferSize"`
}
// ParseAnnotations parses the annotations contained in the ingress

View file

@ -20,9 +20,9 @@ import (
"errors"
"fmt"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
)
const (
@ -48,19 +48,19 @@ var (
// Note: Is possible to specify both limits
type RateLimit struct {
// Connections indicates a limit with the number of connections per IP address
Connections Zone
Connections Zone `json:"connections"`
// RPS indicates a limit with the number of connections per second
RPS Zone
RPS Zone `json:"rps"`
}
// Zone returns information about the NGINX rate limit (limit_req_zone)
// http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req_zone
type Zone struct {
Name string
Limit int
Burst int
Name string `json:"name"`
Limit int `json:"limit"`
Burst int `json:"burst"`
// SharedSize amount of shared memory for the zone
SharedSize int
SharedSize int `json:"sharedSize"`
}
// ParseAnnotations parses the annotations contained in the ingress

View file

@ -19,10 +19,10 @@ package rewrite
import (
"errors"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/ingress/core/pkg/ingress/defaults"
"k8s.io/kubernetes/pkg/apis/extensions"
)
const (
@ -34,12 +34,12 @@ const (
// Redirect describes the per location redirect config
type Redirect struct {
// Target URI where the traffic must be redirected
Target string
Target string `json:"target"`
// AddBaseURL indicates if is required to add a base tag in the head
// of the responses from the upstream servers
AddBaseURL bool
AddBaseURL bool `json:"addBaseUrl"`
// SSLRedirect indicates if the location section is accessible SSL only
SSLRedirect bool
SSLRedirect bool `json:"sslRedirect"`
}
// ParseAnnotations parses the annotations contained in the ingress

View file

@ -17,9 +17,9 @@ limitations under the License.
package secureupstream
import (
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
)
const (

View file

@ -19,10 +19,10 @@ package sslpassthrough
import (
"fmt"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
"k8s.io/ingress/core/pkg/ingress/defaults"
"k8s.io/kubernetes/pkg/apis/extensions"
)
const (