Documentation ¶
Overview ¶
Package cookbook handles the basic building block of any chef (or goiardi) run, the humble cookbook.
Index ¶
- func DependsCookbooks(run_list []string, env_constraints map[string]string) (map[string]interface{}, error)
- func GetList() []string
- type Cookbook
- func (c *Cookbook) ConstrainedInfoHash(num_results interface{}, constraint string) map[string]interface{}
- func (c *Cookbook) Delete() error
- func (c *Cookbook) DeleteVersion(cb_version string) util.Gerror
- func (c *Cookbook) GetName() string
- func (c *Cookbook) GetVersion(cbVersion string) (*CookbookVersion, util.Gerror)
- func (c *Cookbook) InfoHash(num_results interface{}) map[string]interface{}
- func (c *Cookbook) LatestConstrained(constraint string) *CookbookVersion
- func (c *Cookbook) LatestVersion() *CookbookVersion
- func (c *Cookbook) NewVersion(cb_version string, cbv_data map[string]interface{}) (*CookbookVersion, util.Gerror)
- func (c *Cookbook) NumVersions() int
- func (c *Cookbook) Save() error
- func (c *Cookbook) URLType() string
- func (c *Cookbook) UpdateLatestVersion()
- type CookbookVersion
- func (c *CookbookVersion) GetName() string
- func (cbv *CookbookVersion) RecipeList() ([]string, util.Gerror)
- func (cbv *CookbookVersion) ToJson(method string) map[string]interface{}
- func (c *CookbookVersion) URLType() string
- func (cbv *CookbookVersion) UpdateVersion(cbv_data map[string]interface{}, force string) util.Gerror
- type VersionStrings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cookbook ¶
type Cookbook struct { Name string Versions map[string]*CookbookVersion // contains filtered or unexported fields }
The Cookbook struct holds an array of cookbook versions, which is where the run lists, definitions, attributes, etc. are.
func AllCookbooks ¶ added in v0.5.0
func AllCookbooks() (cookbooks []*Cookbook)
Return all the cookbooks that have been uploaded to this server.
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) DeleteVersion ¶
Delete a particular version of a cookbook.
func (*Cookbook) GetVersion ¶
func (c *Cookbook) GetVersion(cbVersion string) (*CookbookVersion, util.Gerror)
Get a particular version of the cookbook.
func (*Cookbook) InfoHash ¶
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
Get the latest version of this cookbook.
func (*Cookbook) NewVersion ¶
func (c *Cookbook) NewVersion(cb_version string, cbv_data map[string]interface{}) (*CookbookVersion, util.Gerror)
Create a new version of the cookbook.
func (*Cookbook) NumVersions ¶ added in v0.5.0
The number of versions this cookbook has.
func (*Cookbook) UpdateLatestVersion ¶
func (c *Cookbook) UpdateLatestVersion()
Update what the cookbook stores as the latest version available.
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"` // contains filtered or unexported fields }
CookbookVersion is the meat of the cookbook. This is what's set when a new cookbook is uploaded.
func (*CookbookVersion) GetName ¶ added in v0.5.1
func (c *CookbookVersion) GetName() string
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{}
Helper function that coverts the internal representation of a cookbook version to JSON in a way that knife and chef-client expect.
func (*CookbookVersion) URLType ¶ added in v0.5.1
func (c *CookbookVersion) URLType() string
func (*CookbookVersion) UpdateVersion ¶
func (cbv *CookbookVersion) UpdateVersion(cbv_data map[string]interface{}, force string) util.Gerror
Update a specific version of a cookbook.
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)