catalog

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2016 License: BSD-2-Clause Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	// Unsorted contains the list of resources created by Lua
	Unsorted []resource.Resource `luar:"-"`
	// contains filtered or unexported fields
}

Catalog type contains a collection of resources

func New added in v0.3.0

func New(config *Config) *Catalog

New creates a new empty catalog with the provided configuration

func (*Catalog) Add added in v0.3.0

func (c *Catalog) Add(resources ...resource.Resource)

Add adds a resource to the catalog. This method is called from Lua when adding new resources

func (*Catalog) Load added in v0.3.0

func (c *Catalog) Load() error

Load loads resources into the catalog

func (*Catalog) Run

func (c *Catalog) Run() *Status

Run processes the resources from catalog

type Config

type Config struct {
	// Name of the Lua module to load and execute
	Module string

	// Do not take any actions, just report what would be done
	DryRun bool

	// Writer used to log events
	Logger *log.Logger

	// Path to the site repo containing module and data files
	SiteRepo string

	// The Lua state
	L *lua.LState

	// Number of goroutines to use for concurrent processing
	Concurrency int
}

Config type represents a set of settings to use when creating and processing the catalog

type Status added in v0.5.0

type Status struct {
	sync.RWMutex

	// Items contain the status for resources after being processed.
	Items map[string]*StatusItem
}

Status type contains status information about processed resources.

func (*Status) Summary added in v0.5.0

func (s *Status) Summary(l *log.Logger)

Summary displays a summary of the resource status.

type StatusItem added in v0.5.0

type StatusItem struct {
	// StateChanged field specifies whether or not a resource has changed
	// after being evaluated and processed.
	StateChanged bool

	// Err contains any errors that were encountered during resource
	// evaluation and processing.
	Err error
}

StatusItem type represents a single item for a processed resource.

Jump to

Keyboard shortcuts

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