builder

package
v0.0.0-...-7a64cd9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: BSD-2-Clause-Patent Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2024 Harness Inc. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AptDep

type AptDep struct {
	Name string `json:"name"`
}

AptDep is a dependency for apt

type Bash

type Bash struct {
	Script string `json:"script"`
}

type BrewDep

type BrewDep struct {
	Name string `json:"name"`
}

BrewDep is a dependency for brew

type Builder

type Builder struct {
	TaskYmlPath string // path to the task.yml file which contains instructions for execution
}

func New

func New(taskYmlPath string) *Builder

func (*Builder) Build

func (b *Builder) Build(ctx context.Context) (string, error)

Build parses the task.yml file and generates the executable binary for a task

type Deps

type Deps struct {
	// keeping these as structs instead of string lists so they can be extended
	// in the future if needed.
	Apt  []AptDep  `json:"apt"`
	Brew []BrewDep `json:"brew"`
}

Deps represents the dependencies for different package managers

type Go

type Go struct {
	Module string `json:"module"`
}

Go represents the Go module configuration

type Run

type Run struct {
	Go   *Go   `json:"go"`
	Bash *Bash `json:"bash"`
}

Run represents the run configuration

type Spec

type Spec struct {
	Deps Deps `json:"deps"`
	Run  Run  `json:"run"`
}

type TaskConfig

type TaskConfig struct {
	Spec Spec `json:"task"`
}

func Parse

func Parse(r io.Reader) (*TaskConfig, error)

Parse parses the configuration from io.Reader r.

func ParseBytes

func ParseBytes(b []byte) (*TaskConfig, error)

ParseBytes parses the configuration from bytes b.

func ParseFile

func ParseFile(p string) (*TaskConfig, error)

ParseFile parses the configuration from path p.

func ParseString

func ParseString(s string) (*TaskConfig, error)

ParseString parses the configuration from string s.

Jump to

Keyboard shortcuts

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