go-sourcehut
Go client package for sourcehut.
Currently, go-sourcehut is tested with Go version 1.16.
Installation
go-sourcehut is compatible with modern Go releases in module mode, with Go
installed:
go get git.sr.ht/~oarmstrong/go-sourcehut
will resolve and add the package to the current development module, along with
its dependencies.
Alternatively the same can be achieved if you use import in a package:
import "git.sr.ht/~oarmstrong/go-sourcehut"
and run go get
without parameters.
Usage
import "git.sr.ht/~oarmstrong/go-sourcehut/git" // git.sr.ht
Construct a new client for the service, passing in a sr.ht personal access token
generated from meta.sr.ht. For example:
client := git.NewClient(os.Getenv("SRHT_TOKEN"))
// read a repository with an ID
repo, err := client.ReadRepository(123)
Validation and Error Handling
go-sourcehut makes little attempt at validating any input due to a lack in
current documentation of the restrictions of fields.
Errors are returned verbatim from the underlying GraphQL library.
Support
If you have any questions, issues or comments please feel free to send an email
to the public mailing list for this project at ~oarmstrong/go-sourcehut-discuss@lists.sr.ht
.
Please review the mailing list
etiquette before posting. Thanks!
Contributing
Contributions are welcome and gratefully received from anyone. Contributing to
go-sourcehut is a little different to projects on other platforms, patches can
be sent in via email. If you need some guidance on how to send patches to this
project (and many other on sr.ht!) you can find an interactive tutorial at
https://git-send-email.io.
Thanks in advance for anything you can contribute!
License
This library is distributed under the MIT license found in the LICENSE file.