Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileRender ¶
Types ¶
type AppConfigItemHelper ¶
type AppConfigItemHelper interface {
// ConfigItem returns the wrapped item when name matches the item name,
// otherwise the matching nested sub-item; it returns nil when no match
// is found.
ConfigItem(name string) *inapi.AppDeployConfigItem
}
AppConfigItemHelper provides read access to a single config item, typically a group selected via ConfigArrayGroup. It abstracts away whether the requested item is the wrapped item itself or one of its nested sub-items.
type AppDependConfigHelper ¶
type AppDependConfigHelper interface {
// ConfigItem returns the dependency config item named name, or nil when
// not present.
ConfigItem(name string) *inapi.AppDeployConfigItem
// ConfigArrayGroup locates, within the dependency config item identified
// by name, the nested group whose sub-item keyName equals keyValue, and
// returns a helper over that group. It returns nil when not found.
ConfigArrayGroup(name, keyName, keyValue string) AppConfigItemHelper
// Service looks up a service port named name across the dependency's
// replicas and returns the owning replica together with the matched port.
// It returns (nil, nil) when no match is found.
Service(name string) (*inapi.AppDeployReplica, *inapi.AppDeployServicePort)
}
AppDependConfigHelper provides read access to a resolved dependency binding (inapi.AppDeployDepend): its config items, array-group selections, and the service ports exposed by its replicas.
type AppReplicaHelper ¶
type AppReplicaHelper interface {
// ReplicaInstance returns the underlying AppReplicaInstance.
ReplicaInstance() *inapi.AppReplicaInstance
// Spec returns the AppSpec of the running instance.
Spec() *inapi.AppSpec
// ConfigItem looks up a config item by dotted name. A plain "name" matches
// a top-level item; "name.sub" matches the nested item "sub" within it.
// It returns nil when no matching item is found.
ConfigItem(name string) *inapi.AppDeployConfigItem
// ConfigArrayGroup locates, within the config item identified by name, the
// nested group whose sub-item keyName equals keyValue, and returns a helper
// over that group. It returns nil when name is missing or no group matches.
ConfigArrayGroup(name, keyName, keyValue string) AppConfigItemHelper
// Service returns the service port matching name and, when port > 0, port.
// The name argument supports an exact match or a "prefix*" wildcard.
Service(name string, port uint32) *inapi.AppDeployServicePort
// Params returns the flattened key/value parameter map derived from the
// instance (self config, dependencies, packages, network endpoints),
// suitable for ${var} template substitution.
Params() map[string]string
// Depend returns a helper over the resolved dependency whose SpecName
// equals name, or nil when no such dependency is declared.
Depend(name string) AppDependConfigHelper
// Update reports whether the backing app_replica.json has been modified
// since the helper was created or last refreshed. When it returns true the
// tracked modification time is advanced, so subsequent reads observe the
// new values.
Update() bool
}
AppReplicaHelper is the read-only facade over the AppReplicaInstance loaded from the local app_replica.json file by NewAppReplicaHelper. It is the entry point used by inagent scripts to inspect the running replica's spec, config items, service ports, dependencies, and the flattened template parameters.
func NewAppReplicaHelper ¶
func NewAppReplicaHelper() (AppReplicaHelper, error)