Documentation ¶
Index ¶
- func Cache() photon.MiddlewareFunc
- func CacheWithConfig(config CacheConfig) photon.MiddlewareFunc
- func Client(client *http.Client) photon.MiddlewareFunc
- func Decoding() photon.MiddlewareFunc
- func DecodingWithConfig(config DecodingConfig) photon.MiddlewareFunc
- func Filter() photon.MiddlewareFunc
- func FilterWithConfig(config FilterConfig) photon.MiddlewareFunc
- func FilterWithFunc(filterFunc FilterFunc) photon.MiddlewareFunc
- func FromCache() photon.MiddlewareFunc
- func FromCacheWithConfig(config FromCacheConfig) photon.MiddlewareFunc
- func FromContext(lastCtx photon.Context) photon.MiddlewareFunc
- func Header(headerMap map[string]string) photon.MiddlewareFunc
- func Limit(duration time.Duration) photon.MiddlewareFunc
- func LimitWithConfig(config LimitConfig) photon.MiddlewareFunc
- func LimitWithFunc(limitFunc LimitFunc) photon.MiddlewareFunc
- func Proxy(u *url.URL) photon.MiddlewareFunc
- func Timeout(t time.Duration) photon.MiddlewareFunc
- func Transport(transport http.RoundTripper) photon.MiddlewareFunc
- func UserAgent(useragents ...string) photon.MiddlewareFunc
- func UserAgentWithConfig(config UserAgentConfig) photon.MiddlewareFunc
- type CacheConfig
- type CacheDrive
- type DecodingConfig
- type FileDriver
- type FilterConfig
- type FilterFunc
- type FromCacheConfig
- type FromCacheDrive
- type LimitConfig
- type LimitFunc
- type UserAgentConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cache ¶
func Cache() photon.MiddlewareFunc
func CacheWithConfig ¶
func CacheWithConfig(config CacheConfig) photon.MiddlewareFunc
func Decoding ¶
func Decoding() photon.MiddlewareFunc
func DecodingWithConfig ¶
func DecodingWithConfig(config DecodingConfig) photon.MiddlewareFunc
func Filter ¶
func Filter() photon.MiddlewareFunc
func FilterWithConfig ¶
func FilterWithConfig(config FilterConfig) photon.MiddlewareFunc
func FilterWithFunc ¶
func FilterWithFunc(filterFunc FilterFunc) photon.MiddlewareFunc
func FromCache ¶
func FromCache() photon.MiddlewareFunc
func FromCacheWithConfig ¶
func FromCacheWithConfig(config FromCacheConfig) photon.MiddlewareFunc
func FromContext ¶
func FromContext(lastCtx photon.Context) photon.MiddlewareFunc
func LimitWithConfig ¶
func LimitWithConfig(config LimitConfig) photon.MiddlewareFunc
func LimitWithFunc ¶
func LimitWithFunc(limitFunc LimitFunc) photon.MiddlewareFunc
func Transport ¶
func Transport(transport http.RoundTripper) photon.MiddlewareFunc
func UserAgent ¶
func UserAgent(useragents ...string) photon.MiddlewareFunc
func UserAgentWithConfig ¶
func UserAgentWithConfig(config UserAgentConfig) photon.MiddlewareFunc
Types ¶
type CacheConfig ¶
type CacheConfig struct { Driver CacheDrive AllowStatus []int }
type DecodingConfig ¶
type DecodingConfig struct { }
type FileDriver ¶
type FileDriver struct {
// contains filtered or unexported fields
}
func NewFileDriver ¶
func NewFileDriver(cacheDir string) *FileDriver
type FilterConfig ¶
type FilterConfig struct {
FilterFunc FilterFunc
}
type FilterFunc ¶
type FromCacheConfig ¶
type FromCacheConfig struct {
Driver FromCacheDrive
}
type LimitConfig ¶
type LimitConfig struct {
LimitFunc LimitFunc
}
type UserAgentConfig ¶
type UserAgentConfig struct {
UserAgent []string
}
Click to show internal directories.
Click to hide internal directories.