bundle

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package bundle implements bundle loading.

Index

Constants

View Source
const (
	RegoExt = ".rego"
)

Common file extensions and file names.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, bundle Bundle) error

Write serializes the Bundle and writes it to w.

Types

type Bundle

type Bundle struct {
	Manifest Manifest
	Data     map[string]interface{}
	Modules  []ModuleFile
}

Bundle represents a loaded bundle. The bundle can contain data and policies.

func Read

func Read(r io.Reader) (Bundle, error)

Read returns a new Bundle loaded from the reader.

func (Bundle) Equal

func (b Bundle) Equal(other Bundle) bool

Equal returns true if this bundle's contents equal the other bundle's contents.

type Manifest

type Manifest struct {
	Revision string `json:"revision"`
}

Manifest represents the manifest from a bundle. The manifest may contain metadata such as the bundle revision.

type ModuleFile

type ModuleFile struct {
	Path   string
	Raw    []byte
	Parsed *ast.Module
}

ModuleFile represents a single module contained a bundle.

Jump to

Keyboard shortcuts

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