go-paste/v2/app.artifact.go
xuu b82a1e954e
All checks were successful
Deploy / deploy (push) Successful in 1m21s
feat: create v2 for module support
2023-10-19 17:07:37 -06:00

27 lines
447 B
Go

package main
import (
"context"
"go.sour.is/paste/v2/artifact"
"go.sour.is/pkg/env"
"go.sour.is/pkg/lg"
"go.sour.is/pkg/service"
)
var _ = apps.Register(40, func(ctx context.Context, svc *service.Harness) error {
_, span := lg.Span(ctx)
defer span.End()
store := env.Default("ARTIFACT_STORE", "data/")
a, err := artifact.New(store, -1)
if err != nil {
return err
}
svc.Add(a)
span.AddEvent("register artifact")
return nil
})