Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
francesconi committed Jan 17, 2025
1 parent 9612702 commit f2c655b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ go get github.com/HGV/alpinebits

## Usage

### Routing
### Routing

```go
package main

import (
"net/http"

"github.com/HGV/alpinebits/v_2018_10"
"github.com/HGV/alpinebits/v_2018_10"
"github.com/HGV/alpinebits/v_2020_10"
"github.com/go-chi/chi/v5"
)
Expand All @@ -41,7 +41,7 @@ func alpinebitsRouter() http.Handler {
})
r.Version(v202010, func(s *Subrouter) {
s.Action(v_2020_10.ActionHotelInvCountNotif, pushHotelInvCountNotif, alpinebits.WithCapabilities(
v_2020_10.CapabilityHotelInvCountNotifAcceptRooms,
v_2020_10.CapabilityHotelInvCountNotifAcceptRooms,
v_2020_10.CapabilityHotelInvCountNotifAcceptDeltas,
v_2020_10.CapabilityHotelInvCountNotifAcceptOutOfOrder,
v_2020_10.CapabilityHotelInvCountNotifAcceptOutOfMarket,
Expand All @@ -57,4 +57,19 @@ func pushHotelAvailNotif(r Request) (any, error) {
func pushHotelInvCountNotif(r Request) (any, error) {
return nil, nil
}
```
```

## Testing

> [!IMPORTANT]
> Ensure `libxml2` and `libxml2-dev` are installed before running the tests. You can install them using:
```sh
sudo apt install libxml2 libxml2-dev
```

Run all tests:

```sh
go test ./...
```

0 comments on commit f2c655b

Please sign in to comment.