Documentation ¶
Index ¶
- func HandleHttp(endpoints []HttpEndpoint) http.HandlerFunc
- type ApiOnlyServiceType
- type HostHttpMatcher
- type HttpEndpoint
- type HttpEndpointConfig
- type HttpMatcher
- type HttpRequestMatcher
- type HttpRequestMatcherConfig
- type HttpResponderConfig
- type HttpResponderContent
- type HttpServiceType
- type KeyValuesHttpMatcher
- type KeyValuesHttpMatcherConfig
- type ModeConfig
- type NamedHttpEndpoint
- type QueryParamHttpMatcher
- type ResembleConfig
- type RestServiceType
- type ServiceType
- type UrlPathHttpMatcher
- type VerbHttpMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleHttp ¶
func HandleHttp(endpoints []HttpEndpoint) http.HandlerFunc
Types ¶
type ApiOnlyServiceType ¶
type ApiOnlyServiceType struct {
// contains filtered or unexported fields
}
func (ApiOnlyServiceType) Configure ¶
func (s ApiOnlyServiceType) Configure()
func (ApiOnlyServiceType) Name ¶
func (s ApiOnlyServiceType) Name() string
func (ApiOnlyServiceType) Serve ¶
func (s ApiOnlyServiceType) Serve()
type HostHttpMatcher ¶
type HostHttpMatcher struct {
// contains filtered or unexported fields
}
func NewHostHttpMatcher ¶
func NewHostHttpMatcher(regularExpr string) (matcher HostHttpMatcher, err error)
func (HostHttpMatcher) MatchHost ¶
func (m HostHttpMatcher) MatchHost(host string) bool
type HttpEndpoint ¶
type HttpEndpointConfig ¶
type HttpEndpointConfig struct { Name string MatcherConfigs []HttpRequestMatcherConfig `yaml:"matchers"` ResponderConfigs []HttpResponderConfig `yaml:"responders"` }
type HttpMatcher ¶
type HttpRequestMatcher ¶
type HttpRequestMatcher struct { Name string Matchers []HttpMatcher }
type HttpRequestMatcherConfig ¶
type HttpRequestMatcherConfig struct { Name string VerbRegexString string `yaml:"verb_regex"` HostRegexString string `yaml:"host_regex"` PathRegexString string `yaml:"path_regex"` QueryParams []KeyValuesHttpMatcherConfig `yaml:"query_params"` Headers []KeyValuesHttpMatcherConfig `yaml:"headers"` }
func (HttpRequestMatcherConfig) NewMatcher ¶
func (m HttpRequestMatcherConfig) NewMatcher() (matcher HttpMatcher, err error)
type HttpResponderConfig ¶
type HttpResponderConfig struct { Name string Mode string Content HttpResponderContent }
type HttpResponderContent ¶
type HttpServiceType ¶
type HttpServiceType struct {
// contains filtered or unexported fields
}
func (HttpServiceType) Configure ¶
func (s HttpServiceType) Configure()
func (HttpServiceType) Name ¶
func (s HttpServiceType) Name() string
func (HttpServiceType) Serve ¶
func (s HttpServiceType) Serve()
type KeyValuesHttpMatcher ¶
func (KeyValuesHttpMatcher) MatchKeyValues ¶
func (m KeyValuesHttpMatcher) MatchKeyValues(params map[string][]string) bool
type KeyValuesHttpMatcherConfig ¶
type KeyValuesHttpMatcherConfig struct { KeyRegexString string `yaml:"key_regex"` ValueRegexString string `yaml:"value_regex"` }
func (KeyValuesHttpMatcherConfig) NewMatcher ¶
func (m KeyValuesHttpMatcherConfig) NewMatcher() (matcher QueryParamHttpMatcher, err error)
type ModeConfig ¶
type ModeConfig struct {
Name string
}
type NamedHttpEndpoint ¶
type NamedHttpEndpoint struct { Name string Matchers []HttpMatcher }
func (NamedHttpEndpoint) Respond ¶
func (e NamedHttpEndpoint) Respond(res http.ResponseWriter, req *http.Request)
type QueryParamHttpMatcher ¶
type QueryParamHttpMatcher struct {
KeyValuesHttpMatcher
}
type ResembleConfig ¶
type ResembleConfig struct { TypeName string `yaml:"type"` EndpointConfigs []HttpEndpointConfig `yaml:"endpoints"` ModeConfigs []ModeConfig `yaml:"modes"` }
func ReadHttpConfiguration ¶
func ReadHttpConfiguration(configYaml string) (resembleConfig ResembleConfig, err error)
type RestServiceType ¶
type RestServiceType struct {
// contains filtered or unexported fields
}
func (RestServiceType) Configure ¶
func (s RestServiceType) Configure()
func (RestServiceType) Name ¶
func (s RestServiceType) Name() string
func (RestServiceType) Serve ¶
func (s RestServiceType) Serve()
type ServiceType ¶
type ServiceType interface { Name() string Configure() Serve() }
func ConfigureService ¶
func ConfigureService(configYaml string) (s ServiceType, err error)
type UrlPathHttpMatcher ¶
type UrlPathHttpMatcher struct {
// contains filtered or unexported fields
}
func NewUrlPathHttpMatcher ¶
func NewUrlPathHttpMatcher(regularExpr string) (matcher UrlPathHttpMatcher, err error)
func (UrlPathHttpMatcher) MatchUrlPath ¶
func (m UrlPathHttpMatcher) MatchUrlPath(urlPath string) bool
type VerbHttpMatcher ¶
type VerbHttpMatcher struct {
// contains filtered or unexported fields
}
func NewVerbHttpMatcher ¶
func NewVerbHttpMatcher(regularExpr string) (matcher VerbHttpMatcher, err error)
func (VerbHttpMatcher) MatchVerb ¶
func (m VerbHttpMatcher) MatchVerb(verb string) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.