Revert "changed the way we handle custom types"

This reverts commit 7690f83101.
This commit is contained in:
Nils Stinnesbeck 2023-03-26 17:24:27 +02:00
parent 7690f83101
commit 431cc0f1ad
Signed by: nils
GPG Key ID: 9AEBF097A4042590

View File

@ -14,12 +14,9 @@ import (
"github.com/netbox-community/go-netbox/v3/netbox/client" "github.com/netbox-community/go-netbox/v3/netbox/client"
) )
// Client is the type we use to add custom functions // NetBoxAPI is the type we use to add custom functions
type Client client.NetBoxAPI
// NetBoxAPI is the struct we use to glue everything together
type NetBoxAPI struct { type NetBoxAPI struct {
api Client api client.NetBoxAPI
Token string Token string
URL string URL string
} }
@ -46,9 +43,8 @@ func NewNetBoxClient(token string, url string) (NetBoxAPI, error) {
n := client.New(t, nil) n := client.New(t, nil)
// create a new variable for our custom functions // create a new variable for our custom functions
api := Client(*n)
nb := NetBoxAPI{ nb := NetBoxAPI{
api: api, api: *n,
Token: token, Token: token,
URL: url, URL: url,
} }