Add context support

This commit is contained in:
Paul Tyng
2020-03-26 16:12:52 -04:00
parent 19709dff50
commit d076e78005
65 changed files with 642 additions and 405 deletions

View File

@@ -1,21 +1,23 @@
package unifi
func (c *Client) ListPortForward(site string) ([]PortForward, error) {
return c.listPortForward(site)
import "context"
func (c *Client) ListPortForward(ctx context.Context, site string) ([]PortForward, error) {
return c.listPortForward(ctx, site)
}
func (c *Client) GetPortForward(site, id string) (*PortForward, error) {
return c.getPortForward(site, id)
func (c *Client) GetPortForward(ctx context.Context, site, id string) (*PortForward, error) {
return c.getPortForward(ctx, site, id)
}
func (c *Client) DeletePortForward(site, id string) error {
return c.deletePortForward(site, id)
func (c *Client) DeletePortForward(ctx context.Context, site, id string) error {
return c.deletePortForward(ctx, site, id)
}
func (c *Client) CreatePortForward(site string, d *PortForward) (*PortForward, error) {
return c.createPortForward(site, d)
func (c *Client) CreatePortForward(ctx context.Context, site string, d *PortForward) (*PortForward, error) {
return c.createPortForward(ctx, site, d)
}
func (c *Client) UpdatePortForward(site string, d *PortForward) (*PortForward, error) {
return c.updatePortForward(site, d)
func (c *Client) UpdatePortForward(ctx context.Context, site string, d *PortForward) (*PortForward, error) {
return c.updatePortForward(ctx, site, d)
}