mirror of
https://github.com/Bornholm/formidable.git
synced 2024-12-24 07:49:33 +01:00
24 lines
371 B
Go
24 lines
371 B
Go
|
package stdout
|
||
|
|
||
|
import (
|
||
|
"io"
|
||
|
"net/url"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
const SchemeStdout = "stdout"
|
||
|
|
||
|
type UpdaterHandler struct{}
|
||
|
|
||
|
func (h *UpdaterHandler) Match(url *url.URL) bool {
|
||
|
return url.Scheme == SchemeStdout
|
||
|
}
|
||
|
|
||
|
func (u *UpdaterHandler) Update(url *url.URL) (io.WriteCloser, error) {
|
||
|
return os.Stdout, nil
|
||
|
}
|
||
|
|
||
|
func NewUpdaterHandler() *UpdaterHandler {
|
||
|
return &UpdaterHandler{}
|
||
|
}
|