Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMethodNotSupported = errors.New("method not supported") ErrXForwardedMethodNotSet = errors.New("header X-Forwarded-Method isn't set") ErrNoCookie = errors.New("http: named cookie not present") ErrNoHeader = errors.New("missing parameters header") ErrNoQueryParam = errors.New("missing query param") ErrInvalidLocation = errors.New("invalid `in` value for parameters") ErrEndpointNotFound = errors.New("no endpoint matches request") ErrInvalidTemplating = errors.New("not a valid template string") ErrBracketsMustNotBeNextToEachOther = errors.New("brackets must not be next to each other") ErrBracketsCannotBeNested = errors.New("brackets cannot be nested") ErrBracketNotClosed = errors.New("bracket wasn't closed") ErrBracketNotOpened = errors.New("bracket not opened before closed") ErrColonNotAllowed = errors.New("`:` not allowed in templating") ErrSlashNotAllowed = errors.New("`/` not allowed in templating") )
Functions ¶
func ErrParameterNotDefined ¶
Types ¶
type ComponentsConfig ¶
type ComponentsConfig struct {
SecuritySchemas map[string]SecuritySchemaConfig
}
func (ComponentsConfig) Validate ¶
func (c ComponentsConfig) Validate() error
type Endpoint ¶
type Endpoint struct { Parameters map[string]string Security []SecurityConfig Audience []string }
type EndpointsConfig ¶
type EndpointsConfig struct { Components ComponentsConfig Paths PathsConfig }
func LoadEndpointsYAML ¶
func LoadEndpointsYAML(fileName string, config *EndpointsConfig) (*EndpointsConfig, error)
func LoadMultipleEndpoints ¶
func LoadMultipleEndpoints(files []string) (*EndpointsConfig, error)
func (EndpointsConfig) Validate ¶
func (c EndpointsConfig) Validate() error
type Method ¶
type Method struct { Parameters []ParameterConfig Security []SecurityConfig Audience []string }
type MethodConfig ¶
type MethodConfig struct { Parameters []ParameterConfig Security []SecurityConfig Audience []string `yaml:"x-audience"` }
func (MethodConfig) Validate ¶
func (c MethodConfig) Validate() error
type ParameterConfig ¶
func (ParameterConfig) Validate ¶
func (c ParameterConfig) Validate() error
type PathConfig ¶
type PathConfig struct { Get *MethodConfig Post *MethodConfig Put *MethodConfig Delete *MethodConfig Patch *MethodConfig }
func (PathConfig) Validate ¶
func (c PathConfig) Validate() error
type PathsConfig ¶
type PathsConfig map[string]PathConfig
func (PathsConfig) Validate ¶
func (c PathsConfig) Validate() error
type SecurityConfig ¶
func (SecurityConfig) Validate ¶
func (c SecurityConfig) Validate() error
type SecuritySchemaConfig ¶
type SecuritySchemaConfig struct { Type string // Used in cookies, api key (say in a header) In string // Where to pull it from Name string // Using in Bearer Auth Scheme string }
func (SecuritySchemaConfig) Validate ¶
func (c SecuritySchemaConfig) Validate() error
type Service ¶
type Service interface { LoadConfig(config EndpointsConfig) error MatchRequest(req common.Request) (*Endpoint, error) }
func NewService ¶
func NewService(log logging.Logger, config EndpointsConfig) (Service, error)
Click to show internal directories.
Click to hide internal directories.