Documentation ¶
Overview ¶
Package pydiomiddleware contains the logic for a middleware directive (repetitive task done for a Pydio request)
- Copyright 2007-2016 Abstrium <contact (at) pydio.com>
- This file is part of Pydio. *
- Pydio is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- Pydio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with Pydio. If not, see <http://www.gnu.org/licenses/>. *
- The latest code can be found at <https://pydio.com/>.
Package pydiomiddleware contains the logic for a middleware directive (repetitive task done for a Pydio request)
- Copyright 2007-2016 Abstrium <contact (at) pydio.com>
- This file is part of Pydio. *
- Pydio is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- Pydio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with Pydio. If not, see <http://www.gnu.org/licenses/>. *
- The latest code can be found at <https://pydio.com/>.
Package pydiomiddleware contains the logic for a middleware directive (repetitive task done for a Pydio request)
- Copyright 2007-2016 Abstrium <contact (at) pydio.com>
- This file is part of Pydio. *
- Pydio is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- Pydio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with Pydio. If not, see <http://www.gnu.org/licenses/>. *
- The latest code can be found at <https://pydio.com/>.
Package pydiomiddleware contains the logic for a middleware directive (repetitive task done for a Pydio request)
- Copyright 2007-2016 Abstrium <contact (at) pydio.com>
- This file is part of Pydio. *
- Pydio is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- Pydio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with Pydio. If not, see <http://www.gnu.org/licenses/>. *
- The latest code can be found at <https://pydio.com/>.
Package pydiomiddleware contains the logic for a middleware directive (repetitive task done for a Pydio request)
- Copyright 2007-2016 Abstrium <contact (at) pydio.com>
- This file is part of Pydio. *
- Pydio is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- Pydio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with Pydio. If not, see <http://www.gnu.org/licenses/>. *
- The latest code can be found at <https://pydio.com/>.
Index ¶
- func NewAuthJob(ctx context.Context, url url.URL, encoder Encoder, close func() error, ...) (pydioworker.Job, error)
- func NewNodeJob(ctx context.Context, url url.URL, encoder Encoder, close func() error, ...) (pydioworker.Job, error)
- func NewRequestJob(ctx context.Context, u url.URL, headers [][2]string, cookies []*http.Cookie, ...) (pydioworker.Job, error)
- func Parse(c *caddy.Controller, path string, middlewares ...string) (rules map[string][]Rule, err error)
- type AuthJob
- type ClientQuery
- type Encoder
- type EncoderFunc
- type Handler
- type NodeJob
- type OptionsQuery
- type Out
- type PathQuery
- type ProxyQuery
- type RequestJob
- type Rule
- type TokenQuery
- type UserQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthJob ¶
func NewAuthJob( ctx context.Context, url url.URL, encoder Encoder, close func() error, cancel func(), ) (pydioworker.Job, error)
NewAuthJob prepares the job for the middleware request based on the rules
func NewNodeJob ¶
func NewNodeJob( ctx context.Context, url url.URL, encoder Encoder, close func() error, cancel func(), ) (pydioworker.Job, error)
NewNodeJob prepares the job for the middleware request based on the rules
func NewRequestJob ¶
func NewRequestJob( ctx context.Context, u url.URL, headers [][2]string, cookies []*http.Cookie, out Out, replacer httpserver.Replacer, encoder Encoder, writer http.ResponseWriter, close func() error, cancel func(), ) (pydioworker.Job, error)
NewRequestJob prepares the job for the middleware request based on the rules
Types ¶
type Handler ¶
type Handler struct { Next httpserver.Handler Rules []Rule Dispatcher *pydioworker.Dispatcher }
Handler for the pydio middleware
type ProxyQuery ¶
type ProxyQuery struct { Key string `json:"key"` ClientID string `json:"client"` Hash string `json:"hash"` Base string `json:"base"` MainEndpoint string `json:"main_endpoint"` DownloadEndpoint string `json:"dl_endpoint"` ShortenType string `json:"shorten_type"` PublicURL string `json:"public_url"` }
ProxyQuery json
type RequestJob ¶
type RequestJob struct { Request http.Request HandleFunc func(string, io.Reader, http.Header) error ErrorFunc func() }
RequestJob definition for the uploader
type Rule ¶
type Rule struct { Path string URL url.URL Regexp *regexp.Regexp CookieMatchers []pydhttp.CookieMatcher Cookies []*http.Cookie QueryMatchers []string QueryArgs map[string][]string HeaderMatchers []string Headers [][2]string QueryType string Out Out EncoderFunc EncoderFunc Matcher httpserver.RequestMatcher }
Rule for the Handler