Retire dormant prompt compatibility APIs
This commit is contained in:
@@ -23,7 +23,7 @@ const (
|
||||
templateIDTomorrow = "tomorrow"
|
||||
)
|
||||
|
||||
type validator func([]byte) (any, []byte, error)
|
||||
type validator func([]byte) (any, error)
|
||||
|
||||
type renderContextBuilder func(report.ID, string, briefing.PreparedIdentity, module.Snapshot, facts.DerivedFacts, any) (any, error)
|
||||
|
||||
@@ -133,9 +133,9 @@ func (h Handler) Template() (string, error) {
|
||||
return source, nil
|
||||
}
|
||||
|
||||
func (h Handler) Validate(data []byte) (any, []byte, error) {
|
||||
func (h Handler) Validate(data []byte) (any, error) {
|
||||
if h.validate == nil {
|
||||
return nil, nil, fmt.Errorf("generated text validator is not registered for schema %q on report %q", h.schemaID, h.reportID)
|
||||
return nil, fmt.Errorf("generated text validator is not registered for schema %q on report %q", h.schemaID, h.reportID)
|
||||
}
|
||||
return h.validate(data)
|
||||
}
|
||||
@@ -155,19 +155,19 @@ func (h Handler) Render(data any) ([]byte, error) {
|
||||
return rendered, nil
|
||||
}
|
||||
|
||||
func validateHourly(data []byte) (any, []byte, error) {
|
||||
func validateHourly(data []byte) (any, error) {
|
||||
return ValidateHourly(data)
|
||||
}
|
||||
|
||||
func validateDaily(data []byte) (any, []byte, error) {
|
||||
func validateDaily(data []byte) (any, error) {
|
||||
return ValidateDaily(data)
|
||||
}
|
||||
|
||||
func validateToday(data []byte) (any, []byte, error) {
|
||||
func validateToday(data []byte) (any, error) {
|
||||
return ValidateToday(data)
|
||||
}
|
||||
|
||||
func validateTomorrow(data []byte) (any, []byte, error) {
|
||||
func validateTomorrow(data []byte) (any, error) {
|
||||
return ValidateTomorrow(data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user