pydiomiddleware

package
v0.0.0-...-b99a58d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2017 License: AGPL-3.0 Imports: 19 Imported by: 0

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

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

func Parse

func Parse(c *caddy.Controller, path string, middlewares ...string) (rules map[string][]Rule, err error)

Parse the middleware rules

Types

type AuthJob

type AuthJob struct {
	HandleFunc func() error
}

AuthJob definition for the uploader

func (*AuthJob) Do

func (j *AuthJob) Do() (err error)

Do the job

type ClientQuery

type ClientQuery struct {
	ID string
}

ClientQuery json

type Encoder

type Encoder interface {
	Encode(v interface{}) error
}

Encoder interface

type EncoderFunc

type EncoderFunc func(v interface{}) Encoder

EncoderFunc Adapter

type Handler

type Handler struct {
	Next       httpserver.Handler
	Rules      []Rule
	Dispatcher *pydioworker.Dispatcher
}

Handler for the pydio middleware

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

ServerHTTP Requests for uploading files to the server

type NodeJob

type NodeJob struct {
	HandleFunc func() error
}

NodeJob definition for the uploader

func (*NodeJob) Do

func (j *NodeJob) Do() (err error)

Do the job

type OptionsQuery

type OptionsQuery struct {
	pydio.Options
}

OptionsQuery json

type Out

type Out struct {
	Name string
	Key  string
}

Out values

type PathQuery

type PathQuery struct {
	Action string     `path:",0:1"`
	Node   pydio.Node `path:",1:last"`
}

PathQuery structure

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

func (*RequestJob) Do

func (j *RequestJob) Do() (err error)

Do the job

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

type TokenQuery

type TokenQuery pydhttp.Token

TokenQuery json

type UserQuery

type UserQuery struct {
	User pydio.User `xml:"user" json:"u"`
}

UserQuery xml

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL