openmeter / subscription /workflow /annotations.go
Leon4gr45's picture
Upload folder using huggingface_hub (part 7)
16cdcb7 verified
Raw
History Blame Contribute Delete
520 Bytes
package subscriptionworkflow
import (
"github.com/oklog/ulid/v2"
"github.com/openmeterio/openmeter/pkg/models"
)
const (
AnnotationEditUniqueKey = "subscription.workflow.patchid"
)
type annotationParser struct{}
var AnnotationParser = annotationParser{}
func (a annotationParser) SetUniquePatchID(annotations models.Annotations) models.Annotations {
id := ulid.Make().String()
if annotations == nil {
annotations = models.Annotations{}
}
annotations[AnnotationEditUniqueKey] = id
return annotations
}