api was not exported, changed that

This commit is contained in:
Nils Stinnesbeck 2023-03-26 17:34:41 +02:00
parent 431cc0f1ad
commit c2f0f06b59
Signed by: nils
GPG Key ID: 9AEBF097A4042590
2 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ import (
// NetBoxAPI is the type we use to add custom functions // NetBoxAPI is the type we use to add custom functions
type NetBoxAPI struct { type NetBoxAPI struct {
api client.NetBoxAPI API client.NetBoxAPI
Token string Token string
URL string URL string
} }
@ -44,7 +44,7 @@ func NewNetBoxClient(token string, url string) (NetBoxAPI, error) {
// create a new variable for our custom functions // create a new variable for our custom functions
nb := NetBoxAPI{ nb := NetBoxAPI{
api: *n, API: *n,
Token: token, Token: token,
URL: url, URL: url,
} }

View File

@ -29,7 +29,7 @@ func (nb NetBoxAPI) GetPrefixes(param ipam.IpamPrefixesListParams) ([]*models.Pr
} }
// get prefixes // get prefixes
prefixes, err := nb.api.Ipam.IpamPrefixesList(&param, nil) prefixes, err := nb.API.Ipam.IpamPrefixesList(&param, nil)
if err != nil { if err != nil {
return nil, e.FormatError("can't get prefixes", err) return nil, e.FormatError("can't get prefixes", err)
} }
@ -83,7 +83,7 @@ func (nb NetBoxAPI) GetIPAddresses(param ipam.IpamIPAddressesListParams) ([]*mod
} }
// get addresses // get addresses
addresses, err := nb.api.Ipam.IpamIPAddressesList(&param, nil) addresses, err := nb.API.Ipam.IpamIPAddressesList(&param, nil)
if err != nil { if err != nil {
return nil, e.FormatError("can't get prefixes", err) return nil, e.FormatError("can't get prefixes", err)
} }