k8s_client v0.1.3 K8s.Client.Route

Handles identifying and interpolating URI paths.

Link to this section Summary

Link to this section Functions

Link to this function

make_route_key(action_name, api_version, kind, arg_names)
make_route_key(binary(), binary(), binary(), [atom()]) :: binary()

Makes a route key.

Sorts the args because the interpolation doesn't care, and it makes finding the key much easier.

Examples

iex> K8s.Client.Route.make_route_key(:get, "v1", "Pod", [:name, :namespace])
"get/v1/pod/name/namespace"

iex> K8s.Client.Route.make_route_key(:get, "v1", :Pod, [:name, :namespace])
"get/v1/pod/name/namespace"

iex> K8s.Client.Route.make_route_key(:get, "v1", :pod, [:name, :namespace])
"get/v1/pod/name/namespace"
Link to this function

replace_path_vars(path_template, opts)
replace_path_vars(binary(), keyword(atom())) :: binary()

Replaces path variables with options.

Examples

iex> K8s.Client.Route.replace_path_vars("/foo/{name}", name: "bar")
"/foo/bar"