buildscript

package
v0.0.0-...-7426b64 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildscriptNotExist = errors.New("Build script does not exist")

Functions

func Initialize

func Initialize(path string, auth *authentication.Auth) error

func Update

func Update(proj projecter, atTime *strfmt.DateTime, newExpr *buildexpression.BuildExpression) error

Types

type Assignment

type Assignment struct {
	Key   string `parser:"@Ident '='"`
	Value *Value `parser:"@@"`
}

func (*Assignment) MarshalJSON

func (a *Assignment) MarshalJSON() ([]byte, error)

type FuncCall

type FuncCall struct {
	Name      string   `parser:"@Ident"`
	Arguments []*Value `parser:"'(' @@ (',' @@)* ','? ')'"`
}

func (*FuncCall) MarshalJSON

func (f *FuncCall) MarshalJSON() ([]byte, error)

type In

type In struct {
	FuncCall *FuncCall `parser:"@@"`
	Name     *string   `parser:"| @Ident"`
}

type Null

type Null struct {
	Null string `parser:"'null'"`
}

type Script

type Script struct {
	Assignments []*Assignment `parser:"@@+"`
	AtTime      *strfmt.DateTime
	Expr        *buildexpression.BuildExpression
}

Script's tagged fields will be initially filled in by Participle. expr will be constructed later and is this script's buildexpression. We keep a copy of the build expression here with any changes that have been applied before either writing it to disk or submitting it to the build planner. It's easier to operate on build expressions directly than to modify or manually populate the Participle-produced fields and re-generate a build expression.

func New

func New(data []byte) (*Script, error)

func NewFromBuildExpression

func NewFromBuildExpression(atTime *strfmt.DateTime, expr *buildexpression.BuildExpression) (*Script, error)

func ScriptFromFile

func ScriptFromFile(path string) (*Script, error)

func ScriptFromProject

func ScriptFromProject(proj projecter) (*Script, error)

func (*Script) Equals

func (s *Script) Equals(other *Script) bool

func (*Script) MarshalJSON

func (s *Script) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Participle-produced Script into an equivalent buildexpression. Users of buildscripts do not need to do this manually; the Expr field contains the equivalent buildexpression.

func (*Script) String

func (s *Script) String() string

type Value

type Value struct {
	FuncCall *FuncCall `parser:"@@"`
	List     *[]*Value `parser:"| '[' (@@ (',' @@)* ','?)? ']'"`
	Str      *string   `parser:"| @String"`
	Number   *float64  `parser:"| (@Float | @Int)"`
	Null     *Null     `parser:"| @@"`

	Assignment *Assignment    `parser:"| @@"`                        // only in FuncCall
	Object     *[]*Assignment `parser:"| '{' @@ (',' @@)* ','? '}'"` // only in List
	Ident      *string        `parser:"| @Ident"`                    // only in FuncCall or Assignment
}

func (*Value) MarshalJSON

func (v *Value) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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