Documentation ¶
Index ¶
- Constants
- func NewCatchError(config conf.Section) (func(http.Handler) http.Handler, error)
- func NewContext(mc ring.MemcacheRing, log srv.LowLevelLogger, policyList conf.PolicyList, ...) func(http.Handler) http.Handler
- func NewCopyMiddleware(config conf.Section) (func(http.Handler) http.Handler, error)
- func NewFormPost(config conf.Section) (func(http.Handler) http.Handler, error)
- func NewHealthcheck(config conf.Section) (func(http.Handler) http.Handler, error)
- func NewRatelimiter(config conf.Section) (func(http.Handler) http.Handler, error)
- func NewRequestLogger(config conf.Section) (func(http.Handler) http.Handler, error)
- func NewTempAuth(config conf.Section) (func(http.Handler) http.Handler, error)
- func NewTempURL(config conf.Section) (func(http.Handler) http.Handler, error)
- func Recover(w http.ResponseWriter, r *http.Request, msg string)
- func RegisterInfo(name string, data interface{})
- func RemoveItemsWithPrefix(header http.Header, prefix string)
- type AccountInfo
- type AuthorizeFunc
- type CopyWriter
- type PipeResponseWriter
- type ProxyContext
- func (ctx *ProxyContext) DefaultPolicyIndex() int
- func (ctx *ProxyContext) GetAccountInfo(account string) *AccountInfo
- func (ctx *ProxyContext) GetContainerInfo(account, container string) *client.ContainerInfo
- func (ctx *ProxyContext) HTTPClient() *http.Client
- func (ctx *ProxyContext) InvalidateAccountInfo(account string)
- func (ctx *ProxyContext) InvalidateContainerInfo(account, container string)
- func (ctx *ProxyContext) NewSubRequest(request *http.Request, method string, url string, body io.Reader) (*http.Request, error)
- func (ctx *ProxyContext) PolicyByName(name string) *conf.Policy
- func (ctx *ProxyContext) Response() (bool, int)
- func (ctx *ProxyContext) Subrequest(method, path string, body io.Reader, writer http.ResponseWriter) (*http.Request, error)
- type ProxyContextMiddleware
Constants ¶
View Source
const ( FP_INVALID = iota FP_ERROR FP_EXPIRED FP_SCOPE_ACCOUNT FP_SCOPE_CONTAINER )
View Source
const ( SCOPE_INVALID = iota SCOPE_ACCOUNT SCOPE_CONTAINER )
Variables ¶
This section is empty.
Functions ¶
func NewCatchError ¶
func NewContext ¶
func NewContext(mc ring.MemcacheRing, log srv.LowLevelLogger, policyList conf.PolicyList, httpClient *http.Client) func(http.Handler) http.Handler
func NewCopyMiddleware ¶
func NewHealthcheck ¶
func NewRatelimiter ¶
func NewRequestLogger ¶
func RegisterInfo ¶
func RegisterInfo(name string, data interface{})
func RemoveItemsWithPrefix ¶
Types ¶
type AccountInfo ¶
type AuthorizeFunc ¶
type CopyWriter ¶
type CopyWriter struct { Logger srv.LowLevelLogger // contains filtered or unexported fields }
func (*CopyWriter) Header ¶
func (cw *CopyWriter) Header() http.Header
func (*CopyWriter) WriteHeader ¶
func (cw *CopyWriter) WriteHeader(status int)
type PipeResponseWriter ¶
type PipeResponseWriter struct { Logger srv.LowLevelLogger // contains filtered or unexported fields }
func NewPipeResponseWriter ¶
func NewPipeResponseWriter(writer *io.PipeWriter, done chan bool, logger srv.LowLevelLogger) *PipeResponseWriter
func (*PipeResponseWriter) Close ¶
func (w *PipeResponseWriter) Close()
func (*PipeResponseWriter) Header ¶
func (w *PipeResponseWriter) Header() http.Header
func (*PipeResponseWriter) WriteHeader ¶
func (w *PipeResponseWriter) WriteHeader(status int)
type ProxyContext ¶
type ProxyContext struct { *ProxyContextMiddleware C client.ProxyClient Authorize AuthorizeFunc Logger srv.LowLevelLogger // contains filtered or unexported fields }
func GetProxyContext ¶
func GetProxyContext(r *http.Request) *ProxyContext
func (*ProxyContext) DefaultPolicyIndex ¶
func (ctx *ProxyContext) DefaultPolicyIndex() int
func (*ProxyContext) GetAccountInfo ¶
func (ctx *ProxyContext) GetAccountInfo(account string) *AccountInfo
func (*ProxyContext) GetContainerInfo ¶
func (ctx *ProxyContext) GetContainerInfo(account, container string) *client.ContainerInfo
func (*ProxyContext) HTTPClient ¶
func (ctx *ProxyContext) HTTPClient() *http.Client
func (*ProxyContext) InvalidateAccountInfo ¶
func (ctx *ProxyContext) InvalidateAccountInfo(account string)
func (*ProxyContext) InvalidateContainerInfo ¶
func (ctx *ProxyContext) InvalidateContainerInfo(account, container string)
func (*ProxyContext) NewSubRequest ¶
func (*ProxyContext) PolicyByName ¶
func (ctx *ProxyContext) PolicyByName(name string) *conf.Policy
func (*ProxyContext) Response ¶
func (ctx *ProxyContext) Response() (bool, int)
func (*ProxyContext) Subrequest ¶
func (ctx *ProxyContext) Subrequest(method, path string, body io.Reader, writer http.ResponseWriter) (*http.Request, error)
type ProxyContextMiddleware ¶
type ProxyContextMiddleware struct { Cache ring.MemcacheRing // contains filtered or unexported fields }
func (*ProxyContextMiddleware) ServeHTTP ¶
func (m *ProxyContextMiddleware) ServeHTTP(writer http.ResponseWriter, request *http.Request)
Click to show internal directories.
Click to hide internal directories.