init

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package init is an internal package with helpers for data and policy loading during initialization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleLoader

type BundleLoader struct {
	DirectoryLoader bundle.DirectoryLoader
	IsDir           bool
}

BundleLoader contains information about files in a bundle

type Descriptor

type Descriptor struct {
	Root string
	Path string
}

Descriptor contains information about a file

type InsertAndCompileOptions

type InsertAndCompileOptions struct {
	Store                 storage.Store
	Txn                   storage.Transaction
	Files                 loader.Result
	Bundles               map[string]*bundle.Bundle
	MaxErrors             int
	EnablePrintStatements bool
}

InsertAndCompileOptions contains the input for the operation.

type InsertAndCompileResult

type InsertAndCompileResult struct {
	Compiler *ast.Compiler
	Metrics  metrics.Metrics
}

InsertAndCompileResult contains the output of the operation.

func InsertAndCompile

func InsertAndCompile(ctx context.Context, opts InsertAndCompileOptions) (*InsertAndCompileResult, error)

InsertAndCompile writes data and policy into the store and returns a compiler for the store contents.

type LoadPathsResult

type LoadPathsResult struct {
	Bundles map[string]*bundle.Bundle
	Files   loader.Result
}

LoadPathsResult contains the output loading a set of paths.

func LoadPaths

func LoadPaths(paths []string, filter loader.Filter, asBundle bool, bvc *bundle.VerificationConfig, skipVerify bool) (*LoadPathsResult, error)

LoadPaths reads data and policy from the given paths and returns a set of bundles or raw loader file results.

type WalkPathsResult

type WalkPathsResult struct {
	BundlesLoader   []BundleLoader
	FileDescriptors []*Descriptor
}

WalkPathsResult contains the output loading a set of paths.

func WalkPaths

func WalkPaths(paths []string, filter loader.Filter, asBundle bool) (*WalkPathsResult, error)

WalkPaths reads data and policy from the given paths and returns a set of bundle directory loaders or descriptors that contain information about files.

Jump to

Keyboard shortcuts

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