Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { ApiVersion string `yaml:"apiVersion"` Spec []struct { Host string `yaml:"host"` Routes []struct { Path string `yaml:"path"` Methods []string `yaml:"methods"` Protocol string `yaml:"protocol"` AllowAnonymous bool `yaml:"allow_anonymous"` AllowedRoles []string `yaml:"allowed_roles"` } `yaml:"routes"` } `yaml:"spec"` }
func ParseConfig ¶
type Ingress ¶
type Ingress struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg *Config, authenticator auth.Authenticator, globalMiddleware []mux.MiddlewareFunc, apiMiddleware []mux.MiddlewareFunc) (*Ingress, error)
New create a new ingress router. The config specifies with back-ends the gateway has. This cannot be nil The authenticator is used for the /auth(/login,/logout,/register,/refresh) endpoints. globalMiddleware is a slice of middleware functions that are applied on every request that comes in apiMiddleware is a slice of middleware function that are applied on any request starting with /api/v1. (These are defined in the config).
func (*Ingress) Use ¶
func (i *Ingress) Use(mfw ...mux.MiddlewareFunc)
Click to show internal directories.
Click to hide internal directories.