parser

package
v0.0.0-...-300ac43 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package parser enables parsing of cue sources

Index

Constants

This section is empty.

Variables

View Source
var (
	// CueTemplate contains the bare cue source template used to generate
	// cue files
	CueTemplate = `` /* 1250-byte string literal not displayed */

)

Functions

This section is empty.

Types

type P2PLabInstance

type P2PLabInstance struct {
	*cue.Instance
}

P2PLabInstance is a wrapper around a cue instance which exposes helper functions to reduce lookup verbosity

func (*P2PLabInstance) ToExperimentDefinition

func (p *P2PLabInstance) ToExperimentDefinition() (metadata.ExperimentDefinition, error)

ToExperimentDefinition returns the cue source as a metadata.ExperimentDefinition type

func (*P2PLabInstance) ToTrialDefinitions

func (p *P2PLabInstance) ToTrialDefinitions() ([]metadata.TrialDefinition, error)

ToTrialDefinitions returns the slice of all trials to be run

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser bundles the cue runtime with helper functions to enable parsing of cue source files

func NewParser

func NewParser(entrypoints []string) *Parser

NewParser returns a ready to use cue parser

func (*Parser) Compile

func (p *Parser) Compile(name string, cueSource string) (*P2PLabInstance, error)

Compile is used to compile the given cue source into our runtime it returns a wrapped cue.Instance that provides helper lookup functions

Jump to

Keyboard shortcuts

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