instance.go
author Mikael Berthe <mikael@lilotux.net>
Mon, 17 Apr 2017 10:28:10 +0200
changeset 130 c450bb73f59a
parent 120 579912e9d0ef
child 138 23d3a518d0ad
permissions -rw-r--r--
Update credits
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
130
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 120
diff changeset
     1
/*
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 120
diff changeset
     2
Copyright 2017 Mikael Berthe
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 120
diff changeset
     3
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 120
diff changeset
     4
Licensed under the MIT license.  Please see the LICENSE file is this directory.
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 120
diff changeset
     5
*/
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 120
diff changeset
     6
112
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     7
package gondole
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     8
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     9
import (
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    10
	"github.com/sendgrid/rest"
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
)
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    12
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
// GetCurrentInstance returns current instance information
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    14
func (g *Client) GetCurrentInstance() (*Instance, error) {
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    15
	var i Instance
120
579912e9d0ef Refactor API calls
Mikael Berthe <mikael@lilotux.net>
parents: 112
diff changeset
    16
	if err := g.apiCall("instance", rest.Get, nil, &i); err != nil {
579912e9d0ef Refactor API calls
Mikael Berthe <mikael@lilotux.net>
parents: 112
diff changeset
    17
		return nil, err
112
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
	}
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    19
	return &i, nil
467dd91bf1f9 Add GetCurrentInstance()
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    20
}