project

package
v0.0.0-...-a1fe3bc Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SpecFileName = "sg-project.yaml"

SpecFileName is the default name of the project specification file.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileTargetSpec

type FileTargetSpec struct {
	// Name - name of the target.
	Name string `json:"name"`
	// Paths - paths to the targets to check.
	Paths []string `json:"paths"`
	// Policies - paths to the policy to load.
	Policies strListOrMap `json:"policies"`
	// Data - paths to the (extra) data to load.
	Data []string `json:"data"`
}

FileTargetSpec defines the specification of a file target. Without further specification, paths are relative to the context root which is defined during execution.

NOTE: we should always use json tag here, please see the comment in ReadFromYAML for context.

type Spec

type Spec struct {
	Files []FileTargetSpec `json:"files"`
}

Spec defines the project specification.

func ReadFromFile

func ReadFromFile(p string) (Spec, error)

ReadFromFile reads a project specification from a file.

func ReadFromYAML

func ReadFromYAML(src io.Reader) (Spec, error)

ReadFromYAML reads a project specification from YAML.

Jump to

Keyboard shortcuts

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