https://github.com/path-network/go-path
Official GoLang bindings for Path's API
https://github.com/path-network/go-path
Last synced: about 1 month ago
JSON representation
Official GoLang bindings for Path's API
- Host: GitHub
- URL: https://github.com/path-network/go-path
- Owner: path-network
- License: gpl-3.0
- Created: 2020-09-15T18:17:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-13T13:06:01.000Z (over 2 years ago)
- Last Synced: 2025-10-27T17:54:55.237Z (5 months ago)
- Language: Go
- Size: 30.3 KB
- Stars: 5
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Path

[](https://godoc.org/github.com/path-network/go-path/path)
[](https://github.com/path-network/go-path)
The official client library written in Go to interact with Path.net's API
## Installation
The package can be downloaded using Go's builtin get command:
`go get github.com/path-network/go-path/path`
After installing go-path, you may use it in your project by importing it
```go
import "github.com/path-network/go-path/path"
```
## Getting Started
To start using Go Path, you must first request an access token. You may either authenticate using account credentials, or a client ID and client secret:
```go
// Request a new OAuth2 token with our credentials
tokenReq := path.AccessTokenRequest{
Username: "foo",
Password: "bar",
}
// Instantiate a new Path API client using our credentials. An access token will be obtained and used in subsequent
// requests to other endpoints
client, err := path.NewClient(tokenReq)
if err != nil {
log.Fatalf("Error authenticating: %s\n", err.Error())
}
```
After successful authentication, you may access endpoints that require authorization:
```go
rules, err := path.GetRules()
if err != nil {
log.Fatalf("Error fetching rules: %s\n", err.Error())
}
. . .
```
## Documentation
For reference on how to use this package, please refer to the [documentation](https://godoc.org/github.com/path-network/go-path/path).