Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("resource not found")
ErrNotFound is returned by Get when no matching resource exists.
Functions ¶
This section is empty.
Types ¶
type Resource ¶
type Resource struct {
ID string `json:"id"`
Name string `json:"name"`
Kind Kind `json:"kind"`
Type string `json:"type,omitempty"`
Version string `json:"version,omitempty"`
Path string `json:"path"`
Raw string `json:"raw,omitempty"`
LoadedBy []string `json:"loadedBy,omitempty"`
}
Resource describes a single Dapr component or configuration YAML file.
func FromRaw ¶ added in v0.0.10
FromRaw parses multi-document YAML content into fully-populated Resources carrying Raw. displayPath is the entry's Path verbatim (for container sources use "<containerName>:<inContainerPath>") and feeds the ID hash, so same-named components from different containers stay distinct. Unparseable documents and unknown kinds are skipped.
type Service ¶
type Service interface {
List(ctx context.Context, kind Kind) ([]Resource, error)
// Get resolves idOrName as a resource ID first, then as a metadata name
// (first match) so pre-ID deep links keep working.
Get(ctx context.Context, kind Kind, idOrName string) (Resource, error)
}
Service is the interface for listing and fetching Dapr resources.
func New ¶
New returns a Service that scans the paths returned by the provider for Dapr resource YAMLs, merged with the extras provider's entries (resources that exist outside the host filesystem, e.g. extracted from containers). Either provider may be nil. Both are called on every List/Get so callers can change sources at runtime.