https://github.com/jsignanini/foxyproxy-reseller-go
FoxyProxy Reseller API bindings for Go.
https://github.com/jsignanini/foxyproxy-reseller-go
foxy-proxy foxyproxy foxyproxy-reseller
Last synced: 5 months ago
JSON representation
FoxyProxy Reseller API bindings for Go.
- Host: GitHub
- URL: https://github.com/jsignanini/foxyproxy-reseller-go
- Owner: jsignanini
- License: mit
- Created: 2019-12-13T04:18:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-28T21:52:41.000Z (almost 6 years ago)
- Last Synced: 2024-06-20T01:54:05.351Z (almost 2 years ago)
- Topics: foxy-proxy, foxyproxy, foxyproxy-reseller
- Language: Go
- Size: 34.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# foxyproxy-reseller-go
[](http://godoc.org/github.com/jsignanini/foxyproxy-reseller-go)
[](https://travis-ci.org/jsignanini/foxyproxy-reseller-go)
[](https://goreportcard.com/report/github.com/jsignanini/foxyproxy-reseller-go)
[](https://coveralls.io/github/jsignanini/foxyproxy-reseller-go?branch=master)
FoxyProxy Reseller API bindings for Go.
## Installation
Install foxyproxy-reseller-go with:
```sh
go get -u github.com/jsignanini/foxyproxy-reseller-go
```
Then, import it using:
```go
import "github.com/jsignanini/foxyproxy-reseller-go"
```
## Usage
```go
package main
import (
"fmt"
"github.com/jsignanini/foxyproxy-reseller-go"
)
func main() {
client := foxyproxy.NewClient(&foxyproxy.NewClientParams{
DomainHeader: "x-domain-header-provided-by-foxyproxy",
EndpointBaseURL: "https://reseller.test.api.foxyproxy.com",
Username: "foxyproxy-username",
Password: "foxyproxy-password",
})
// get all nodes
nodes, err := client.GetAllNodes(0, 10)
if err != nil {
panic(err)
}
// iterate nodes and print active connections
for _, node := range nodes {
actives, err := node.GetActiveConnectionTotals()
if err != nil {
panic(err)
}
fmt.Printf("Node: %s, Total Active Connections: %d\n", node.Name, actives)
}
}
```