Initialize narratio Go module and CLI scaffold
This commit is contained in:
2
internal/stage/doc.go
Normal file
2
internal/stage/doc.go
Normal file
@@ -0,0 +1,2 @@
|
||||
// Package stage defines pipeline stage contracts and placeholder stage types.
|
||||
package stage
|
||||
63
internal/stage/placeholders.go
Normal file
63
internal/stage/placeholders.go
Normal file
@@ -0,0 +1,63 @@
|
||||
package stage
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/app"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
)
|
||||
|
||||
func notImplemented(name string) error {
|
||||
return fmt.Errorf("stage %q: not yet implemented", name)
|
||||
}
|
||||
|
||||
type Prepare struct{}
|
||||
|
||||
type Transcribe struct{}
|
||||
|
||||
type Normalize struct{}
|
||||
|
||||
type Merge struct{}
|
||||
|
||||
type Polish struct{}
|
||||
|
||||
type Analyze struct{}
|
||||
|
||||
type Archive struct{}
|
||||
|
||||
type Notify struct{}
|
||||
|
||||
func (Prepare) Name() string { return "prepare" }
|
||||
func (Transcribe) Name() string { return "transcribe" }
|
||||
func (Normalize) Name() string { return "normalize" }
|
||||
func (Merge) Name() string { return "merge" }
|
||||
func (Polish) Name() string { return "polish" }
|
||||
func (Analyze) Name() string { return "analyze" }
|
||||
func (Archive) Name() string { return "archive" }
|
||||
func (Notify) Name() string { return "notify" }
|
||||
|
||||
func (s Prepare) Run(_ context.Context, _ *app.Env, _ *manifest.Manifest) (*Result, error) {
|
||||
return nil, notImplemented(s.Name())
|
||||
}
|
||||
func (s Transcribe) Run(_ context.Context, _ *app.Env, _ *manifest.Manifest) (*Result, error) {
|
||||
return nil, notImplemented(s.Name())
|
||||
}
|
||||
func (s Normalize) Run(_ context.Context, _ *app.Env, _ *manifest.Manifest) (*Result, error) {
|
||||
return nil, notImplemented(s.Name())
|
||||
}
|
||||
func (s Merge) Run(_ context.Context, _ *app.Env, _ *manifest.Manifest) (*Result, error) {
|
||||
return nil, notImplemented(s.Name())
|
||||
}
|
||||
func (s Polish) Run(_ context.Context, _ *app.Env, _ *manifest.Manifest) (*Result, error) {
|
||||
return nil, notImplemented(s.Name())
|
||||
}
|
||||
func (s Analyze) Run(_ context.Context, _ *app.Env, _ *manifest.Manifest) (*Result, error) {
|
||||
return nil, notImplemented(s.Name())
|
||||
}
|
||||
func (s Archive) Run(_ context.Context, _ *app.Env, _ *manifest.Manifest) (*Result, error) {
|
||||
return nil, notImplemented(s.Name())
|
||||
}
|
||||
func (s Notify) Run(_ context.Context, _ *app.Env, _ *manifest.Manifest) (*Result, error) {
|
||||
return nil, notImplemented(s.Name())
|
||||
}
|
||||
21
internal/stage/stage.go
Normal file
21
internal/stage/stage.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package stage
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/app"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
)
|
||||
|
||||
// Stage is the pipeline unit contract.
|
||||
type Stage interface {
|
||||
Name() string
|
||||
Run(ctx context.Context, env *app.Env, m *manifest.Manifest) (*Result, error)
|
||||
}
|
||||
|
||||
// Result is the declared output of a stage execution.
|
||||
type Result struct {
|
||||
Outputs []artifacts.Ref
|
||||
Metadata map[string]any
|
||||
}
|
||||
Reference in New Issue
Block a user