2023-11-05 08:30:15 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"go.sour.is/paste/v2/image"
|
|
|
|
"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("IMAGE_STORE", "data/")
|
|
|
|
|
2023-11-09 11:42:33 -07:00
|
|
|
a, err := image.New(ctx, store, -1)
|
2023-11-05 08:30:15 -07:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
svc.Add(a)
|
|
|
|
span.AddEvent("register image")
|
|
|
|
|
|
|
|
return nil
|
|
|
|
})
|