2023-03-31 11:52:04 +02:00
|
|
|
package resource
|
|
|
|
|
2023-03-31 11:59:55 +02:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
|
|
|
|
2023-03-31 23:35:13 +02:00
|
|
|
// 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
|
|
|
|
2023-03-31 23:35:13 +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
|
|
|
}
|