Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![GoDoc](https://godoc.org/github.com/paybyphone/phpipam-sdk-go?status.svg)](https://godoc.org/github.com/paybyphone/phpipam-sdk-go)
[![GoDoc](https://godoc.org/github.com/youkoulayley/phpipam-sdk-go?status.svg)](https://godoc.org/github.com/youkoulayley/phpipam-sdk-go)

# phpipam-sdk-go - Partial SDK for PHPIPAM

Expand All @@ -15,7 +15,7 @@ provider to help insert data gathered from AWS and beyond.

See the [GoDoc][2] for the SDK usage details.

[2]: https://godoc.org/github.com/paybyphone/phpipam-sdk-go
[2]: https://godoc.org/github.com/youkoulayley/phpipam-sdk-go

## A Note on Custom Fields

Expand Down
6 changes: 3 additions & 3 deletions controllers/addresses/addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package addresses
import (
"fmt"

"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/client"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/client"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
)

// Address represents an IP address resource within PHPIPAM.
Expand Down
6 changes: 3 additions & 3 deletions controllers/addresses/addresses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"reflect"
"testing"

"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/paybyphone/phpipam-sdk-go/testacc"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/testacc"
)

var testCreateAddressInput = Address{
Expand Down
8 changes: 4 additions & 4 deletions controllers/sections/sections.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ package sections
import (
"fmt"

"github.com/paybyphone/phpipam-sdk-go/controllers/subnets"
"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/client"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/controllers/subnets"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/client"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
)

// Section represents a PHPIPAM section.
Expand Down
8 changes: 4 additions & 4 deletions controllers/sections/sections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"testing"

"github.com/davecgh/go-spew/spew"
"github.com/paybyphone/phpipam-sdk-go/controllers/subnets"
"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/paybyphone/phpipam-sdk-go/testacc"
"github.com/youkoulayley/phpipam-sdk-go/controllers/subnets"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/testacc"
)

var testListSectionsOutputExpected = []Section{
Expand Down
8 changes: 4 additions & 4 deletions controllers/subnets/subnets.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ package subnets
import (
"fmt"

"github.com/paybyphone/phpipam-sdk-go/controllers/addresses"
"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/client"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/controllers/addresses"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/client"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
)

// Subnet represents a PHPIPAM subnet.
Expand Down
8 changes: 4 additions & 4 deletions controllers/subnets/subnets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"reflect"
"testing"

"github.com/paybyphone/phpipam-sdk-go/controllers/addresses"
"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/paybyphone/phpipam-sdk-go/testacc"
"github.com/youkoulayley/phpipam-sdk-go/controllers/addresses"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/testacc"
)

var testCreateSubnetInput = Subnet{
Expand Down
6 changes: 3 additions & 3 deletions controllers/vlans/vlans.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package vlans
import (
"fmt"

"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/client"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/client"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
)

// VLAN represents a PHPIPAM VLAN.
Expand Down
6 changes: 3 additions & 3 deletions controllers/vlans/vlans_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"reflect"
"testing"

"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/paybyphone/phpipam-sdk-go/testacc"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/testacc"
)

var testCreateVLANInput = VLAN{
Expand Down
6 changes: 3 additions & 3 deletions phpipam/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package client
import (
"fmt"

"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/request"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/request"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
)

// Client encompasses a generic client object that is further extended by
Expand Down
4 changes: 2 additions & 2 deletions phpipam/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"reflect"
"testing"

"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
)

const testDateStamp = "2999-12-31 23:59:59"
Expand Down
9 changes: 2 additions & 7 deletions phpipam/request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"io/ioutil"
"net/http"

"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
)

// APIResponse represents a PHPIPAM response body. Both successful and
Expand Down Expand Up @@ -76,13 +76,8 @@ func (r *requestResponse) BodyString() string {
// request is successful and the response data is unmarshalled.
func (r *requestResponse) ReadResponseJSON(v interface{}) error {
var resp APIResponse
if err := json.Unmarshal(r.Body, &resp); err != nil {
return fmt.Errorf("JSON parsing error: %s - Response body: %s", err, r.Body)
}

if !resp.Success {
return r.handleError()
}
json.Unmarshal(r.Body, &resp);

if string(resp.Data) != "" {
if err := json.Unmarshal(resp.Data, v); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions phpipam/request/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"
"testing"

"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/paybyphone/phpipam-sdk-go/phpipam/session"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam/session"
)

const errorResponseText = `
Expand Down
2 changes: 1 addition & 1 deletion phpipam/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package session

import (
"github.com/imdario/mergo"
"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
)

// timeLayout represents the datetime format returned by the PHPIPAM api.
Expand Down
2 changes: 1 addition & 1 deletion phpipam/session/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/paybyphone/phpipam-sdk-go/phpipam"
"github.com/youkoulayley/phpipam-sdk-go/phpipam"
)

func phpipamConfig() phpipam.Config {
Expand Down
2 changes: 1 addition & 1 deletion sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// Terraform provider to help insert data gathered from AWS and beyond.
//
// For SDK usage, see the GoDoc at
// https://godoc.org/github.com/paybyphone/phpipam-sdk-go.
// https://godoc.org/github.com/youkoulayley/phpipam-sdk-go.
package sdk