Categorygithub.com/Kelado/DeviceService
modulepackage
0.0.0-20240821224112-d6b922debad5
Repository: https://github.com/kelado/deviceservice.git
Documentation: pkg.go.dev

# README

Device Service

This is a service to store and access data related to devices.

Build and run (locally)

To build the binary, run:

make build

the excutable will be stored in ./bin/svc

Or simply run

make

To build and run the binary

API

All paths start with: /api/vi
e.g. GET http://localhost:8000/api/v1/devices, to list all devices

MethodPathDescription
GET/devicesList all devices
GET/devices?s=brand:< value >List all devices with the specified brand (value)
GET/devices/< id >Get a device with the specified id
POST/devicesPost a device giving a name and a brand
PUT/devices/< id >Update partial or full a device given the id
DELETE/devices/< id >Delete a device with the specified id

Test

To test the source code, run:

make test

The important package that needed to be test are:

  • controllers
  • repositories

Also, the coverage is printed along side each package

Containerize

First to build the image, run:

make build-image

And then:

make run-image

This will start a container running the device service

To stop and delete the image, run:

make rmi

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author