The Catalog Service is a RESTful API built with Go that manages a product catalog. It provides CRUD (Create, Read, Update, Delete) .The service uses SQLite for data storage.
- Go 1.16 or later
- SQLite
Start the service:
go run main.go
The service will start on http://localhost:8080
.
GET /items
: Retrieve all catalog itemsPOST /items
: Create a new catalog itemGET /items/{id}
: Retrieve a specific catalog itemPUT /items/{id}
: Update a specific catalog itemDELETE /items/{id}
: Delete a specific catalog item
All endpoints require a valid JWT token in the Authorization header.
The Item
struct represents a catalog item:
type Item struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
ChangedAt time.Time `json:"changed_at"`
CreatedBy string `json:"created_by"`
ChangedBy string `json:"changed_by"`
IsDeleted bool `json:"is_deleted"`
}