module
Version:
v0.0.0-...-8615bd3
Opens a new window with list of versions in this module.
Published: Feb 20, 2019
License: Apache-2.0
Opens a new window with license information.
README
¶
cicd-go
import (
"github.com/banzaicloud/cicd-go/cicd"
"golang.org/x/oauth2"
)
const (
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
host = "http://cicd.company.com"
)
func main() {
// create an http client with oauth authentication.
config := new(oauth2.Config)
auther := config.Client(
oauth2.NoContext,
&oauth2.Token{
AccessToken: token,
},
)
// create the cicd client with authenticator
client := cicd.NewClient(host, auther)
// gets the current user
user, err := client.Self()
fmt.Println(user, err)
// gets the named repository information
repo, err := client.Repo("banzaicloud", "cicd-go")
fmt.Println(repo, err)
}
Directories
¶
|
|
plugin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.