package encoding

import "github.com/open-policy-agent/opa/internal/wasm/encoding"

Package encoding implements WASM module reading and writing.

Index

Functions

func CodeEntries

func CodeEntries(m *module.Module) ([]*module.CodeEntry, error)

CodeEntries returns the WASM code entries contained in r.

func ReadCodeEntry

func ReadCodeEntry(r io.Reader) (*module.CodeEntry, error)

ReadCodeEntry reads a binary-encoded WASM code entry from r.

func ReadModule

func ReadModule(r io.Reader) (*module.Module, error)

ReadModule reads a binary-encoded WASM module from r.

func WriteCodeEntry

func WriteCodeEntry(w io.Writer, entry *module.CodeEntry) error

WriteCodeEntry writes a binary encoded representation of entry to w.

func WriteModule

func WriteModule(w io.Writer, module *module.Module) error

WriteModule writes a binary-encoded representation of module to w.

Source Files

doc.go reader.go writer.go

Version
v1.4.2 (latest)
Published
May 2, 2025
Platform
linux/amd64
Imports
12 packages
Last checked
6 hours ago

Tools for package owners.