go-paste/app.image.go
xuu 1b8e8ad26a
All checks were successful
Go Bump / bump (push) Successful in 37s
chore: add favicon
2023-11-09 13:47:42 -07:00

27 lines
440 B
Go

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/")
a, err := image.New(ctx, store, -1)
if err != nil {
return err
}
svc.Add(a)
span.AddEvent("register image")
return nil
})