Documentation ¶
Index ¶
- type Client
- type ClientAdapter
- func (a *ClientAdapter) RegDeviceGet(orgID, deviceID string) web.EnrollResponse
- func (a *ClientAdapter) RegDeviceList(orgID string) web.DevicesResponse
- func (a *ClientAdapter) RegDeviceUpdate(orgID, deviceID string, body []byte) web.StandardResponse
- func (a *ClientAdapter) RegOrganizationList() web.OrganizationsResponse
- func (a *ClientAdapter) RegisterDevice(body []byte) web.RegisterResponse
- func (a *ClientAdapter) RegisterOrganization(body []byte) web.RegisterResponse
- type MockIdentity
- func (m *MockIdentity) RegDeviceGet(orgID, deviceID string) web.EnrollResponse
- func (m *MockIdentity) RegDeviceList(orgID string) web.DevicesResponse
- func (m *MockIdentity) RegDeviceUpdate(orgID, deviceID string, body []byte) web.StandardResponse
- func (m *MockIdentity) RegOrganizationList() web.OrganizationsResponse
- func (m *MockIdentity) RegisterDevice(body []byte) web.RegisterResponse
- func (m *MockIdentity) RegisterOrganization(body []byte) web.RegisterResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { RegDeviceList(orgID string) web.DevicesResponse RegisterDevice(body []byte) web.RegisterResponse RegDeviceGet(orgID, deviceID string) web.EnrollResponse RegDeviceUpdate(orgID, deviceID string, body []byte) web.StandardResponse RegisterOrganization(body []byte) web.RegisterResponse RegOrganizationList() web.OrganizationsResponse }
Client is a client for the identity API
type ClientAdapter ¶
type ClientAdapter struct {
URL string
}
ClientAdapter adapts our expectations to device twin API
func NewClientAdapter ¶
func NewClientAdapter(u string) (*ClientAdapter, error)
NewClientAdapter creates an adapter to access the device twin service
func (*ClientAdapter) RegDeviceGet ¶
func (a *ClientAdapter) RegDeviceGet(orgID, deviceID string) web.EnrollResponse
RegDeviceGet fetches a device registration
func (*ClientAdapter) RegDeviceList ¶
func (a *ClientAdapter) RegDeviceList(orgID string) web.DevicesResponse
RegDeviceList lists the devices for an account
func (*ClientAdapter) RegDeviceUpdate ¶
func (a *ClientAdapter) RegDeviceUpdate(orgID, deviceID string, body []byte) web.StandardResponse
RegDeviceUpdate updates a device registration
func (*ClientAdapter) RegOrganizationList ¶
func (a *ClientAdapter) RegOrganizationList() web.OrganizationsResponse
RegOrganizationList lists the organizations for an account
func (*ClientAdapter) RegisterDevice ¶
func (a *ClientAdapter) RegisterDevice(body []byte) web.RegisterResponse
RegisterDevice registers a new device
func (*ClientAdapter) RegisterOrganization ¶
func (a *ClientAdapter) RegisterOrganization(body []byte) web.RegisterResponse
RegisterOrganization registers a new organization
type MockIdentity ¶
type MockIdentity struct{}
MockIdentity mocks the identity API client
func (*MockIdentity) RegDeviceGet ¶
func (m *MockIdentity) RegDeviceGet(orgID, deviceID string) web.EnrollResponse
RegDeviceGet mocks fetching a registered device
func (*MockIdentity) RegDeviceList ¶
func (m *MockIdentity) RegDeviceList(orgID string) web.DevicesResponse
RegDeviceList mocks listing registered devices
func (*MockIdentity) RegDeviceUpdate ¶
func (m *MockIdentity) RegDeviceUpdate(orgID, deviceID string, body []byte) web.StandardResponse
RegDeviceUpdate mocks updating a registered device
func (*MockIdentity) RegOrganizationList ¶
func (m *MockIdentity) RegOrganizationList() web.OrganizationsResponse
RegOrganizationList mocks listing registered organizations
func (*MockIdentity) RegisterDevice ¶
func (m *MockIdentity) RegisterDevice(body []byte) web.RegisterResponse
RegisterDevice mocks registering a device
func (*MockIdentity) RegisterOrganization ¶
func (m *MockIdentity) RegisterOrganization(body []byte) web.RegisterResponse
RegisterOrganization mocks registering an organization