Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ldez/go-semaphoreci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

49 Commits

Repository files navigation

Go library for accessing the Semaphore CI API

go-semaphoreci is a Go client library for accessing the Semaphore CI API.

  • API v1

  • API v2

    • ✓ read operations

    • ❏ write operations

Examples

API v1

import (
	"log"
	"github.com/ldez/go-semaphoreci/v1"
)
func main() {
	transport := v1.TokenTransport{
	 Token: "your-token",
	}
	client := v1.NewClient(transport.Client())
	projects, _, err := client.Projects.Get()
	if err != nil {
		log.Fatal(err)
	}
	for _, project := range projects {
		log.Println(project)
	}
}

API v2

import (
	"log"
	"github.com/ldez/go-semaphoreci/v2"
)
func main() {
	authToken := v2.TokenTransport{
		Token: "your-token",
	}
	client := v2.NewClient(authToken.Client())
	projects, resp, err := client.Projects.GetByOrg("your-organization")
	if err != nil {
		log.Fatal(err)
	}
	log.Println("HTTP response: ", resp)
	for _, project := range projects {
		log.Println(project)
	}
}

About

Go library for accessing the Semaphore CI API

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /