shad-go/distbuild/pkg/api/build.go
Sergey Paramoshkin dc939b6ed1
update repo
2023-10-02 22:32:41 +03:00

51 lines
908 B
Go

package api
import (
"context"
"gitlab.com/manytask/itmo-go/private/distbuild/pkg/build"
)
type BuildRequest struct {
Graph build.Graph
}
type BuildStarted struct {
ID build.ID
MissingFiles []build.ID
}
type StatusUpdate struct {
JobFinished *JobResult
BuildFailed *BuildFailed
BuildFinished *BuildFinished
}
type BuildFailed struct {
Error string
}
type BuildFinished struct{}
type UploadDone struct{}
type SignalRequest struct {
UploadDone *UploadDone
}
type SignalResponse struct{}
type StatusWriter interface {
Started(rsp *BuildStarted) error
Updated(update *StatusUpdate) error
}
type Service interface {
StartBuild(ctx context.Context, request *BuildRequest, w StatusWriter) error
SignalBuild(ctx context.Context, buildID build.ID, signal *SignalRequest) (*SignalResponse, error)
}
type StatusReader interface {
Close() error
Next() (*StatusUpdate, error)
}