Add context support
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user