resolver-go/internal/closure/types.go
raw ยท 757 bytes
package closure
import "sync"
type CompileState int
const (
CompileMissing CompileState = iota
CompilePending
CompileReady
CompileFailed
)
type CompileRequest struct {
ExternSources []SourceInput `json:"externSources,omitempty"`
JSSources []SourceInput `json:"jsSources"`
Defines map[string]any `json:"defines,omitempty"`
}
type SourceInput struct {
Name string `json:"name"`
Source string `json:"source"`
}
type CompileJob struct {
Hash string
Mode string
ExternSources []SourceInput
JSSources []SourceInput
Defines map[string]any
}
type CompileCache struct {
client *Client
mu sync.Mutex
states map[string]CompileState
results map[string][]byte
errors map[string]error
jobs chan CompileJob
}