Giter Site home page Giter Site logo

gobamboo's Introduction

gobamboo

Go Lib for making HTTP GET requests to a Bamboo server and working with the results as structs.

package main

// example and test

import (
  "fmt"
  "github.com/jmervine/gobamboo" // package is bamboo
)

func main() {
  b    := new(bamboo.Bamboo)
  opts := make(map[string]string)

  b.Domain   = "http://bamboo.example.com"
  b.Username = "USERNAME"
  b.Password = "PASSWORD"

  // info
  info, _ := b.Info(opts) // returns *bamboo.Info
  fmt.Printf("----------\n%#v\n----------\n", info)

  // b.Url must now be reset or regenerated
  //
  //  Note: I had to build it this way for testing. I need to revist this and
  //        see if I can find an effective way around this, that still allows
  //        for unit testing.
  //
  // Reset example:
  b.Url = ""

  // plan
  plan, _ := b.Plan(opts) // returns *bamboo.Plan
  fmt.Printf("----------\n%#v\n----------\n", plan)

  // b.Url must now be reset or regenerated
  //
  // Regenerate example:
  b.GenerateUrl("project")

  // project
  project, _ := b.Project(opts) // returns *bamboo.Project
  fmt.Printf("----------\n%#v\n----------\n", project)

  // queue
  b.GenerateUrl("queue")
  queue, _ := b.Queue(opts) // returns *bamboo.Queue
  fmt.Printf("----------\n%#v\n----------\n", queue)ambo

  // result
  b.GenerateUrl("result")
  result, _ := b.Result(opts) // returns *bamboo.Result
  fmt.Printf("----------\n%#v\n----------\n", result)
}

See example.go for a more useful full example.

gobamboo's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.