Refactor functions.

This commit is contained in:
Kalle Carlbark 2019-09-11 13:13:22 +02:00
parent 37458a35ed
commit 36129c8f88
No known key found for this signature in database
GPG key ID: 3FC0C93C5A5A0670

View file

@ -109,7 +109,7 @@ type InterfaceFilter struct {
Vlan string `schema:"vlan,omitempty"`
}
func (i *Dcim_Interfaces_List) ListInterfaces(n *NetBox, f *InterfaceFilter) error {
func (n *NetBox) ListInterfaces(i *Dcim_Interfaces_List, f *InterfaceFilter) error {
var encoder = schema.NewEncoder()
form := url.Values{}
@ -154,7 +154,7 @@ func (i *Dcim_Interfaces_List) ListInterfaces(n *NetBox, f *InterfaceFilter) err
return nil
}
func (i *Dcim_Interfaces_Create) CreateInterfaces(n *NetBox) error {
func (n *NetBox) CreateInterfaces(i *Dcim_Interfaces_Create) error {
interfaceData, err := json.Marshal(i)
if err != nil {
return err