diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-01 14:51:02 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-01 14:51:02 +0900 |
| commit | d8acd8a29aca25055244b9e28a8ad520e82a41cd (patch) | |
| tree | 7012d3a0bf24593141465f0a55db449edd3857b0 /cmd | |
| parent | f8cab362c0b5d96608bcdc58cc51a596ed69bbe3 (diff) | |
cmd/mbf/internal/ci: document dist endpoint
There will eventually be more endpoints for other CI workloads.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/mbf/internal/ci/ci.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cmd/mbf/internal/ci/ci.go b/cmd/mbf/internal/ci/ci.go index c9d585d4..b19b6ca5 100644 --- a/cmd/mbf/internal/ci/ci.go +++ b/cmd/mbf/internal/ci/ci.go @@ -63,7 +63,7 @@ func inotifyAddWatch( // Follow reads from the file at pathname and writes its contents and any new // contents to w. follow returns if a read, write or inotify error occurs, or -// the context is canceled. +// the context is cancelled. func Follow(ctx context.Context, pathname string, w io.Writer) (err error) { var in *os.File if in, err = inotifyInit(); err != nil { @@ -442,13 +442,19 @@ func (p Path) fetch(ctx context.Context, id *pkg.ID, output string) error { return err } +const ( + // endpointDist accepts a Path.writeSource stream and produces a + // distribution for the submitted source. + endpointDist = "/dist" +) + // MakeDist creates a hakurei distribution using the CI service. func (p Path) MakeDist( ctx context.Context, w io.Writer, output, source, version string, ) error { - id, err := p.writeSource(ctx, w, "/dist", source, version) + id, err := p.writeSource(ctx, w, endpointDist, source, version) if err != nil { return err } @@ -465,7 +471,7 @@ func Serve(ctx context.Context, msg message.Msg, c *pkg.Cache) error { } var mux http.ServeMux - mux.HandleFunc("POST /dist", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("POST "+endpointDist, func(w http.ResponseWriter, r *http.Request) { s, err := readSource(w, r) if err != nil { msg.Verbose(err) |
