starlarkbridge

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFromStarlarkValue added in v0.2.4

func ConvertFromStarlarkValue(thread *starlark.Thread, value starlark.Value) (any, error)

ConvertFromStarlarkValue converts starlark.Value to any value

As ConvertToStarlarkValue, the value is serialized in go and then deserialized in starlark. JSON is used for serialization. so any properties that are not serializable to JSON will be lost.

func ConvertToStarlarkValue added in v0.2.4

func ConvertToStarlarkValue(thread *starlark.Thread, value any) (starlark.Value, error)

ConvertToStarlarkValue converts any value to starlark.Value

Internally the value is serialized in go and then deserialized in starlark. JSON is used for serialization. so any properties that are not serializable to JSON will be lost.

func NewPluginStarlark

func NewPluginStarlark(plugin plugin.Plugin) starlark.HasAttrs

NewPluginStarlark returns a starlark.HasAttrs for the given plugin.Plugin

in starlark, you can access below methods from the value returned by this function

spec_from_file = plugin.loadSpecFile("path/to/spec.yaml")
spec_from_url = plugin.loadSpecUrl("https://example.com/spec.yaml")

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL