cookbook

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2013 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cookbook handles the basic building blocks of any chef (or goiardi) run, the humble cookbook.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DependsCookbooks

func DependsCookbooks(run_list []string, env_constraints map[string]string) (map[string]interface{}, error)

func GetList

func GetList() []string

Types

type Cookbook

type Cookbook struct {
	Name     string
	Versions map[string]*CookbookVersion
	// contains filtered or unexported fields
}

func Get

func Get(name string) (*Cookbook, util.Gerror)

func New

func New(name string) (*Cookbook, util.Gerror)

func (*Cookbook) ConstrainedInfoHash

func (c *Cookbook) ConstrainedInfoHash(num_results interface{}, constraint string) map[string]interface{}

Gets num_results (or all if num_results is nil) versions of a cookbook that match the given constraint and returns a hash describing the cookbook and the versions returned.

func (*Cookbook) Delete

func (c *Cookbook) Delete() error

func (*Cookbook) DeleteVersion

func (c *Cookbook) DeleteVersion(cb_version string) util.Gerror

func (*Cookbook) GetName

func (c *Cookbook) GetName() string

Cookbook methods and functions

func (*Cookbook) GetVersion

func (c *Cookbook) GetVersion(cb_version string) (*CookbookVersion, util.Gerror)

func (*Cookbook) InfoHash

func (c *Cookbook) InfoHash(num_results interface{}) map[string]interface{}

Gets num_results (or all if num_results is nil) versions of a cookbook, returning a hash describing the cookbook and the versions returned.

func (*Cookbook) LatestConstrained

func (c *Cookbook) LatestConstrained(constraint string) *CookbookVersion

Returns the latest version of a cookbook that matches the given constraint. If no constraint is given, returns the latest version.

func (*Cookbook) LatestVersion

func (c *Cookbook) LatestVersion() *CookbookVersion

func (*Cookbook) NewVersion

func (c *Cookbook) NewVersion(cb_version string, cbv_data map[string]interface{}) (*CookbookVersion, util.Gerror)

func (*Cookbook) Save

func (c *Cookbook) Save() error

func (*Cookbook) URLType

func (c *Cookbook) URLType() string

func (*Cookbook) UpdateLatestVersion

func (c *Cookbook) UpdateLatestVersion()

type CookbookVersion

type CookbookVersion struct {
	CookbookName string                   `json:"cookbook_name"`
	Name         string                   `json:"name"`
	Version      string                   `json:"version"`
	ChefType     string                   `json:"chef_type"`
	JsonClass    string                   `json:"json_class"`
	Definitions  []map[string]interface{} `json:"definitions"`
	Libraries    []map[string]interface{} `json:"libraries"`
	Attributes   []map[string]interface{} `json:"attributes"`
	Recipes      []map[string]interface{} `json:"recipes"`
	Providers    []map[string]interface{} `json:"providers"`
	Resources    []map[string]interface{} `json:"resources"`
	Templates    []map[string]interface{} `json:"templates"`
	RootFiles    []map[string]interface{} `json:"root_files"`
	Files        []map[string]interface{} `json:"files"`
	IsFrozen     bool                     `json:"frozen?"`
	Metadata     map[string]interface{}   `json:"metadata"`
}

func (*CookbookVersion) RecipeList

func (cbv *CookbookVersion) RecipeList() ([]string, util.Gerror)

Provide a list of recipes in this cookbook version.

func (*CookbookVersion) ToJson

func (cbv *CookbookVersion) ToJson(method string) map[string]interface{}

func (*CookbookVersion) UpdateVersion

func (cbv *CookbookVersion) UpdateVersion(cbv_data map[string]interface{}, force string) util.Gerror

type VersionStrings

type VersionStrings []string

Make version strings with the format "x.y.z" sortable.

func (VersionStrings) Len

func (v VersionStrings) Len() int

func (VersionStrings) Less

func (v VersionStrings) Less(i, j int) bool

func (VersionStrings) Swap

func (v VersionStrings) Swap(i, j int)

Jump to

Keyboard shortcuts

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