fake

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockClient

type MockClient struct {
	MockCreate func(createRequest *packngo.DeviceCreateRequest) (*packngo.Device, *packngo.Response, error)
	MockUpdate func(deviceID string, createRequest *packngo.DeviceUpdateRequest) (*packngo.Device, *packngo.Response, error)
	MockDelete func(deviceID string, force bool) (*packngo.Response, error)
	MockGet    func(deviceID string, getOpt *packngo.GetOptions) (*packngo.Device, *packngo.Response, error)

	MockDeviceToNetworkType func(deviceID string, networkType string) (*packngo.Device, error)
	MockDeviceNetworkType   func(deviceID string) (string, error)
	MockConvertDevice       func(*packngo.Device, string) error

	MockGetProjectID  func(string) string
	MockGetFacilityID func(string) string
}

MockClient is a fake implementation of packngo.Client.

func (*MockClient) ConvertDevice added in v0.0.5

func (c *MockClient) ConvertDevice(d *packngo.Device, networkType string) error

ConvertDevice calls the MockClient's MockConvertDevice function.

func (*MockClient) Create

func (c *MockClient) Create(createRequest *packngo.DeviceCreateRequest) (*packngo.Device, *packngo.Response, error)

Create calls the MockClient's MockCreate function.

func (*MockClient) Delete

func (c *MockClient) Delete(deviceID string, force bool) (*packngo.Response, error)

Delete calls the MockClient's MockDelete function.

func (*MockClient) DeviceNetworkType

func (c *MockClient) DeviceNetworkType(deviceID string) (string, error)

DeviceNetworkType calls the MockClient's MockDeviceNetworkType function.

func (*MockClient) DeviceToNetworkType

func (c *MockClient) DeviceToNetworkType(deviceID string, networkType string) (*packngo.Device, error)

DeviceToNetworkType calls the MockClient's MockDeviceToNetworkType function.

func (*MockClient) Get

func (c *MockClient) Get(deviceID string, options *packngo.GetOptions) (*packngo.Device, *packngo.Response, error)

Get calls the MockClient's MockGet function.

func (*MockClient) GetFacilityID

func (c *MockClient) GetFacilityID(id string) string

GetFacilityID calls the MockClient's MockGet function.

func (*MockClient) GetProjectID

func (c *MockClient) GetProjectID(id string) string

GetProjectID calls the MockClient's MockGet function.

func (*MockClient) Update

func (c *MockClient) Update(deviceID string, createRequest *packngo.DeviceUpdateRequest) (*packngo.Device, *packngo.Response, error)

Update calls the MockClient's MockUpdate function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL