vise/go/resource/resource.go

16 lines
472 B
Go
Raw Normal View History

2023-03-31 11:52:04 +02:00
package resource
2023-03-31 11:59:55 +02:00
import (
"context"
)
// EntryFunc is a function signature for retrieving value for a key
type EntryFunc func(ctx context.Context) (string, error)
2023-03-31 11:52:04 +02:00
// Resource implementation are responsible for retrieving values and templates for symbols, and can render templates from value dictionaries.
type Resource interface {
2023-03-31 11:59:55 +02:00
Get(sym string) (string, error)
Render(sym string, values map[string]string) (string, error)
FuncFor(sym string) (EntryFunc, error)
2023-03-31 11:52:04 +02:00
}