formidable/internal/data/updater/stdout/updater_handler.go

24 lines
371 B
Go
Raw Normal View History

2022-05-10 22:31:17 +02:00
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{}
}