filestash/server/common/plugin.go
2018-10-30 00:07:10 +11:00

25 lines
685 B
Go

package common
import (
"io"
"net/http"
)
type Register struct{}
type Get struct{}
var Hooks = struct {
Get Get
Register Register
}{
Get: Get{},
Register: Register{},
}
var process_file_content_before_send []func(io.Reader, *App, *http.ResponseWriter, *http.Request) (io.Reader, error)
func (this Register) ProcessFileContentBeforeSend(fn func(io.Reader, *App, *http.ResponseWriter, *http.Request) (io.Reader, error)) {
process_file_content_before_send = append(process_file_content_before_send, fn)
}
func (this Get) ProcessFileContentBeforeSend() []func(io.Reader, *App, *http.ResponseWriter, *http.Request) (io.Reader, error) {
return process_file_content_before_send
}