terraform/vendor/github.com/go-chef/chef
Paul Hinze 6fe2703665 Vendor all dependencies w/ Godep
* Remove `make updatedeps` from Travis build. We'll follow up with more
   specific plans around dependency updating in subsequent PRs.
 * Update all `make` targets to set `GO15VENDOREXPERIMENT=1` and to
   filter out `/vendor/` from `./...` where appropriate.
 * Temporarily remove `vet` from the `make test` target until we can
   figure out how to get it to not vet `vendor/`. (Initial
   experimentation failed to yield the proper incantation.)

Everything is pinned to current master, with the exception of:

 * Azure/azure-sdk-for-go which is pinned before the breaking change today
 * aws/aws-sdk-go which is pinned to the most recent tag

The documentation still needs to be updated, which we can do in a follow
up PR. The goal here is to unblock release.
2016-01-29 15:08:48 -06:00
..
examples Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
test Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
.gitignore Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
LICENSE Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
README.md Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
acl.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
acl_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
authentication.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
build.sh Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
client.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
client_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
cookbook.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
cookbook_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
databag.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
databag_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
debug.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
doc.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
environment.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
environment_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
http.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
http_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
node.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
node_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
reader.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
reader_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
release.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
role.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
role_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
run_list.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
run_list_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
sandbox.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
sandbox_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
search.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
search_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
wercker.yml Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00

README.md

Stories in Ready Build Status Coverage Status

Chef Server API Client Library in Golang

This is a Library that you can use to write tools to interact with the chef server.

Install

go get github.com/go-chef/chef

Test

go get -t github.com/go-chef/chef
go test -v github.com/go-chef/chef

SSL

If you run into an SSL verification problem when trying to connect to a ssl server with self signed certs setup your config object with SkipSSL: true

Usage

This example is setting up a basic client that you can use to interact with all the service endpoints (clients, nodes, cookbooks, etc.) More usage examples can be found in the examples directory.

 package main
 
 import (
 	"encoding/json"
 	"fmt"
 	"io/ioutil"
 	"log"
 	"os"
 
 	"github.com/go-chef/chef"
 )
 
 func main() {
 	// read a client key
 	key, err := ioutil.ReadFile("key.pem")
 	if err != nil {
 		fmt.Println("Couldn't read key.pem:", err)
     os.Exit(1)
   }
 
 	// build a client
 	client, err := chef.NewClient(&chef.Config{
 		Name: "foo",
 		Key:  string(key),
 		// goiardi is on port 4545 by default. chef-zero is 8889
 		BaseURL: "http://localhost:4545",
 	})
 	if err != nil {
 		fmt.Println("Issue setting up client:", err)
   }
 
   // List Cookbooks
   cookList, err := client.Cookbooks.List()
   if err != nil {
     fmt.Println("Issue listing cookbooks:", err)
   }
 
   // Print out the list
   fmt.Println(cookList)
 }

CONTRIBUTING

If you feel like contributing, great! Just fork the repo, make your improvements, and submit a pull request. Tests would, of course, be appreciated. Adding tests where there are no tests currently would be even more appreciated. At least, though, try and not break anything worse than it is. Test coverage has improved, but is still an ongoing concern.

AUTHORS

Jesse Nelson @spheromak
AJ Christensen @fujin
Brad Beam @bradbeam
Kraig Amador @bigkraig

Copyright 2013-2014, Jesse Nelson

LICENSE

Like many Chef ecosystem programs, go-chef/chef is licensed under the Apache 2.0 License. See the LICENSE file for details.

Chef is copyright (c) 2008-2014 Chef, Inc. and its various contributors.

Thanks go out to the fine folks of Opscode and the Chef community for all their hard work.