Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var URLCapsuleType = cty.CapsuleWithOps("url", reflect.TypeOf(URLWrapper{}), &cty.CapsuleOps{ GoString: func(val interface{}) string { w := val.(*URLWrapper) return fmt.Sprintf("url(%s)", w.U.String()) }, TypeGoString: func(_ reflect.Type) string { return "URL" }, })
URLCapsuleType is the cty capsule type for URLWrapper values.
View Source
var URLObjectType = cty.Object(map[string]cty.Type{ "scheme": cty.String, "opaque": cty.String, "username": cty.String, "password": cty.String, "password_set": cty.Bool, "host": cty.String, "hostname": cty.String, "port": cty.String, "path": cty.String, "raw_path": cty.String, "raw_query": cty.String, "query": cty.Map(cty.List(cty.String)), "fragment": cty.String, "raw_fragment": cty.String, "force_query": cty.Bool, "omit_host": cty.Bool, "_capsule": URLCapsuleType, })
URLObjectType is the static cty object type returned by urlparse, urljoin, urljoinpath.
Functions ¶
func BuildURLObject ¶
BuildURLObject builds a cty object value with all URL fields materialized as attributes, plus a _capsule attribute holding the URL capsule.
func GetURLFromCapsule ¶
GetURLFromCapsule extracts a *url.URL from a URL capsule value.
func GetURLFromValue ¶
GetURLFromValue extracts a *url.URL from a string, URL capsule, or URL object (with _capsule attribute). Strings are parsed with url.Parse.
func GetURLFunctions ¶
GetURLFunctions returns all URL-related cty functions for registration in an HCL2 eval context.
Types ¶
type URLWrapper ¶
URLWrapper wraps a parsed *url.URL as a cty capsule.
Click to show internal directories.
Click to hide internal directories.