orderfile

package
v0.0.0-...-345791d Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package orderfile file defines models for Orderfile.yml and its particular substructures as well as some basic abstractraction on data reading.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd string

Cmd represents single script command

type Order

type Order struct {
	Description string `yaml:"description"`
	Script      []Cmd  `yaml:"script"`
}

Order represents single command order

type Orderfile

type Orderfile struct {
	Version string `yaml:"version"`
	Orders  Orders `yaml:"orders"`
}

Orderfile represents single instance of orderfile

func NewOrderFileFrom

func NewOrderFileFrom(path string) (*Orderfile, error)

NewOrderFileFrom parses orderfile under given path and returns it's object representation

func (*Orderfile) GetOrder

func (o *Orderfile) GetOrder(orderName string) (*Order, bool)

GetOrder returns order under given name Or false status for when there is no order with given name

func (*Orderfile) ListOrdersNames

func (o *Orderfile) ListOrdersNames() []string

ListOrdersNames returns string slice with all defined orders

type Orders

type Orders map[string]Order

Orders represents orders section of file

Jump to

Keyboard shortcuts

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