https://github.com/grezar/go-circleci
CircleCI API (V2) Client Library in Go
https://github.com/grezar/go-circleci
apiclient circleci go
Last synced: 6 months ago
JSON representation
CircleCI API (V2) Client Library in Go
- Host: GitHub
- URL: https://github.com/grezar/go-circleci
- Owner: grezar
- License: mit
- Created: 2021-10-24T02:45:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-23T07:33:27.000Z (over 2 years ago)
- Last Synced: 2024-06-18T18:52:52.723Z (about 2 years ago)
- Topics: apiclient, circleci, go
- Language: Go
- Homepage:
- Size: 104 KB
- Stars: 35
- Watchers: 2
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-circleci
[](https://circleci.com/gh/grezar/go-circleci/tree/main)
[](https://opensource.org/licenses/MIT)
This client supports the [CircleCI V2 API](https://circleci.com/docs/api/v2/).
Note this client is in beta. While I am using this client in my personal
projects, many of the methods are not yet used in real projects and have not
been fully tested. Therefore, this client may involve some breaking changes
until it reaches v1.0. If you find any missing features or bugs, please kindly
report it via an Issue or Pull Request.
## Installation
Installation can be done with a normal `go get`:
```sh
go get -u github.com/grezar/go-circleci
```
## Usage
```go
import "github.com/grezar/go-circleci"
```
Construct a new CircleCI client, then use the various services on the client to
access different parts of the CircleCI API. For example, to list all contexts:
```go
config := circleci.DefaultConfig()
config.Token = "put-your-circleci-token-here"
client, err := circleci.NewClient(config)
if err != nil {
log.Fatal(err)
}
contexts, err := client.Contexts.List(context.Background(), circleci.ContextListOptions{
OwnerSlug: circleci.String("org"),
})
if err != nil {
log.Fatal(err)
}
```
## Documentation
TODO: Write code comments for Go Doc.
## Contribution
If you find any issues with this package, please report an Issue.
## TODO
- [ ] Support the [CircleCI Schedule API](https://circleci.com/docs/api/v2/#tag/Schedule).
- [ ] Provide detailed Documentation in Go Doc.
## LICENSE
[The MIT License (MIT)](https://github.com/grezar/go-circleci/blob/main/LICENSE)