config

package
v0.0.0-...-f92de01 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2022 Practically.io All rights reserved

Use of this source is governed by a BSD-style licence that can be found in the LICENCE file or at https://www.practically.io/copyright

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// The excitable for this task
	Command string `json:"command"`
	// A list of arguments that will be passed to the executable
	Arguments []string `json:"arguments"`
}

type Config

type Config struct {
	// The version number for this configuration. Currently this can only be
	// "0.0.1"
	Version string `json:"version"`
	// A map of tasks that are keyed by the task identifier
	Tasks map[string]Task `json:"tasks"`
}

The main configuration for all of the tasks

func Get

func Get(file string) (*Config, error)

Get and creates a new configuration struct from a jsonnet file path

func (*Config) BuildTaskList

func (config *Config) BuildTaskList(id string) ([]Task, error)

func (*Config) FindTask

func (config *Config) FindTask(id string) (Task, error)

Finds a task by the identifier

type Task

type Task struct {
	ID string
	// The title of the task. This is what will be displayed in output
	Title string `json:"title"`
	// The log description of this task
	Description string `json:"description"`
	// The container that the command will be run in
	Image string `json:"image"`
	// The excitable for this task
	Commands []Command `json:"commands"`
	// A list of task ids that this task depends on
	Requires []string `json:"requires"`
}

A single task definition

Jump to

Keyboard shortcuts

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