Documentation
¶
Index ¶
Constants ¶
const StatusNotChecked = "not-checked"
StatusNotChecked marks a reference whose value daprd reads from its own process environment (a local.env store or an envRef). The dashboard only sees its own environment, so any resolved/unset/empty verdict would describe the wrong process; the UI shows the reference without a status instead.
Variables ¶
var ErrNoSecretValue = errors.New("no resolved secret value for field")
ErrNoSecretValue is returned by RevealSecret when the field has no secret reference, or the reference does not resolve to a value.
var ErrNotFound = errors.New("resource not found")
ErrNotFound is returned by Get when no matching resource exists.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.0.19
type Option func(*service)
Option configures the resources Service.
func WithSecrets ¶ added in v0.0.19
WithSecrets attaches a secret resolver so component resources carry secret reference status. Without it, SecretRefs and SecretStore stay empty.
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"`
SecretRefs []SecretRefStatus `json:"secretRefs,omitempty"`
SecretStore *SecretStoreInfo `json:"secretStore,omitempty"`
// contains filtered or unexported fields
}
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 SecretRefStatus ¶ added in v0.0.19
type SecretRefStatus struct {
Field string `json:"field"`
Kind string `json:"kind"`
Store string `json:"store,omitempty"`
Name string `json:"name,omitempty"`
Key string `json:"key,omitempty"`
Status string `json:"status"`
Detail string `json:"detail,omitempty"`
}
SecretRefStatus is one component metadata field that draws its value from a secret reference, with the outcome of resolving it. It never carries the value itself — see the reveal endpoint in pkg/server.
type SecretStoreInfo ¶ added in v0.0.19
type SecretStoreInfo struct {
Name string `json:"name"`
Type string `json:"type"`
File string `json:"file,omitempty"`
Prefix string `json:"prefix,omitempty"`
NestedSeparator string `json:"nestedSeparator,omitempty"`
MultiValued bool `json:"multiValued,omitempty"`
Keys []string `json:"keys,omitempty"`
KeysCapped bool `json:"keysCapped,omitempty"`
InitErr string `json:"initErr,omitempty"`
UsedBy []string `json:"usedBy,omitempty"`
}
SecretStoreInfo describes a local secret-store component for its detail pane. Keys are names only.
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)
// RevealSecret returns the resolved value of a single secret reference on
// a component. It is the only path by which secret material leaves this
// package.
RevealSecret(ctx context.Context, idOrName, field string) (string, 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.