From 7690f831016e7b44e975fdfd9b586ae8a5c74f2a Mon Sep 17 00:00:00 2001 From: Nils Stinnesbeck Date: Sun, 26 Mar 2023 17:08:11 +0200 Subject: [PATCH] changed the way we handle custom types --- client.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 44973b1..4733036 100644 --- a/client.go +++ b/client.go @@ -14,9 +14,12 @@ import ( "github.com/netbox-community/go-netbox/v3/netbox/client" ) -// NetBoxAPI is the type we use to add custom functions +// Client 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 { - api client.NetBoxAPI + api Client Token string URL string } @@ -43,8 +46,9 @@ func NewNetBoxClient(token string, url string) (NetBoxAPI, error) { n := client.New(t, nil) // create a new variable for our custom functions + api := Client(*n) nb := NetBoxAPI{ - api: *n, + api: api, Token: token, URL: url, }