Documentation
¶
Index ¶
- Constants
- func Logger(start time.Time, r *http.Request)
- func Middleware(inner http.Handler) http.Handler
- type DevicesResponse
- type EnrollResponse
- type IdentityService
- func (wb IdentityService) DeviceGet(w http.ResponseWriter, r *http.Request)
- func (wb IdentityService) DeviceList(w http.ResponseWriter, r *http.Request)
- func (wb IdentityService) DeviceUpdate(w http.ResponseWriter, r *http.Request)
- func (wb IdentityService) EnrollDevice(w http.ResponseWriter, r *http.Request)
- func (wb IdentityService) OrganizationList(w http.ResponseWriter, r *http.Request)
- func (wb IdentityService) RegisterDevice(w http.ResponseWriter, r *http.Request)
- func (wb IdentityService) RegisterOrganization(w http.ResponseWriter, r *http.Request)
- func (wb IdentityService) Router() *mux.Router
- func (wb IdentityService) Run() error
- type OrganizationsResponse
- type RegisterResponse
- type StandardResponse
- type Web
Constants ¶
const JSONHeader = "application/json; charset=UTF-8"
JSONHeader is the header for JSON responses
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DevicesResponse ¶
type DevicesResponse struct { StandardResponse Devices []domain.Enrollment `json:"devices"` }
DevicesResponse is the JSON response from a device list API method
type EnrollResponse ¶
type EnrollResponse struct { StandardResponse Enrollment domain.Enrollment `json:"enrollment"` }
EnrollResponse is the JSON response from an enrollment API method
type IdentityService ¶
IdentityService is the implementation of the web API
func NewIdentityService ¶
func NewIdentityService(settings *config.Settings, id service.Identity) *IdentityService
NewIdentityService returns a new web controller
func (IdentityService) DeviceGet ¶
func (wb IdentityService) DeviceGet(w http.ResponseWriter, r *http.Request)
DeviceGet fetches a device registration
func (IdentityService) DeviceList ¶
func (wb IdentityService) DeviceList(w http.ResponseWriter, r *http.Request)
DeviceList fetches device registrations
func (IdentityService) DeviceUpdate ¶
func (wb IdentityService) DeviceUpdate(w http.ResponseWriter, r *http.Request)
DeviceUpdate updates a device registration
func (IdentityService) EnrollDevice ¶
func (wb IdentityService) EnrollDevice(w http.ResponseWriter, r *http.Request)
EnrollDevice connects an IoT device with the identity service
func (IdentityService) OrganizationList ¶
func (wb IdentityService) OrganizationList(w http.ResponseWriter, r *http.Request)
OrganizationList fetches organizations
func (IdentityService) RegisterDevice ¶
func (wb IdentityService) RegisterDevice(w http.ResponseWriter, r *http.Request)
RegisterDevice registers a new device with the identity service
func (IdentityService) RegisterOrganization ¶
func (wb IdentityService) RegisterOrganization(w http.ResponseWriter, r *http.Request)
RegisterOrganization registers a new organization with the identity service
func (IdentityService) Router ¶
func (wb IdentityService) Router() *mux.Router
Router returns the application router
type OrganizationsResponse ¶
type OrganizationsResponse struct { StandardResponse Organizations []domain.Organization `json:"organizations"` }
OrganizationsResponse is the JSON response from a organization list API method
type RegisterResponse ¶
type RegisterResponse struct { StandardResponse ID string `json:"id"` }
RegisterResponse is the JSON response from a registration API method
type StandardResponse ¶
StandardResponse is the JSON response from an API method, indicating success or failure.
type Web ¶
type Web interface { Run() error Router() *mux.Router RegisterOrganization(w http.ResponseWriter, r *http.Request) RegisterDevice(w http.ResponseWriter, r *http.Request) OrganizationList(w http.ResponseWriter, r *http.Request) DeviceList(w http.ResponseWriter, r *http.Request) EnrollDevice(w http.ResponseWriter, r *http.Request) }
Web is the interface for the web API