Documentation ¶
Overview ¶
Package dynamic contains the HCL function, types, and logic for implementing dynamic config sourcing HCL configuration. This doesn't implement the actual logic behind configuration fetching (see `internal/appconfig`), only the declaration in an HCL file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Func implements the configdynamic() HCL function. Func = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "from", Type: cty.String, }, { Name: "config", Type: cty.Map(cty.String), }, }, Type: function.StaticReturnType(Type), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { var config map[string]string if err := gocty.FromCtyValue(args[1], &config); err != nil { return cty.NilVal, err } return cty.CapsuleVal(Type, &pb.ConfigVar_DynamicVal{ From: args[0].AsString(), Config: config, }), nil }, }) // Type is the encapsulated type that is returned by `Func`. // Encapsulated types are opaque in HCL and can be decoded // in Go to native Go types. Type = cty.Capsule("configval", reflect.TypeOf((*pb.ConfigVar_DynamicVal)(nil)).Elem()) )
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.