Skip to content

Commit

Permalink
Add real_world docs
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Nov 10, 2022
1 parent 226bdb0 commit 4175464
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 0 deletions.
119 changes: 119 additions & 0 deletions test/real_world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
### Variables
| Name | Type |
|------|------|
| AppVersion | `string` |
| CleanMarker | `string` |
| CountryCode | `string` |
| CurrencyCode | `string` |
| DestinationCountry | `string` |
| Features | [UserAgentFeatures](#UserAgentFeatures) |
| GateID | `int` |
| InitializedAt | `int` |
| IsAffiliate | `bool` |
| IsDesktop | `bool` |
| IsMobile | `bool` |
| IsOpenJaw | `bool` |
| KnowEnglish | `bool` |
| Locale | `string` |
| Marker | `string` |
| Market | `string` |
| OriginCountry | `string` |
| Os | `string` |
| OsVersion | `string` |
| Passengers | [Passengers](#Passengers) |
| Random | `float` |
| ReferrerHost | `string` |
| SearchDepth | `int` |
| SearchParamsEnv | [SearchParamsEnv](#SearchParamsEnv) |
| Segments | array([RouteSegment](#RouteSegment)) |
| TravelPayoutsAPI | `bool` |
| TripClass | `string` |
| UserAgentDevice | `string` |
| UserAgentType | `string` |
| UserIP | `string` |
| false | `bool` |
| true | `bool` |

### Functions
| Name | Return type |
|------|-------------|
| all(array(`any`), `func`) | `bool` |
| any(array(`any`), `func`) | `bool` |
| count(array(`any`), `func`) | `int` |
| filter(array(`any`), `func`) | array(`any`) |
| len(array(`any`)) | `int` |
| map(array(`any`), `func`) | array(`any`) |
| none(array(`any`), `func`) | `bool` |
| one(array(`any`), `func`) | `bool` |

### Types
#### DirectFlightsDays
| Field | Type |
|---|---|
| Days | `string` |
| Start | `string` |

#### Passengers
| Field | Type |
|---|---|
| Adults | `int` |
| Children | `int` |
| Infants | `int` |

#### RouteSegment
| Field | Type |
|---|---|
| Date | `string` |
| Destination | `string` |
| DestinationCountry | `string` |
| DestinationName | `string` |
| DirectFlightsDays | [DirectFlightsDays](#DirectFlightsDays) |
| Origin | `string` |
| OriginCountry | `string` |
| OriginName | `string` |
| TranslatedDestination | `string` |
| TranslatedOrigin | `string` |
| UserDestination | `string` |
| UserOrigin | `string` |

#### SearchParamsEnv
| Field | Type |
|---|---|
| AppVersion | `string` |
| CleanMarker | `string` |
| CountryCode | `string` |
| CurrencyCode | `string` |
| DestinationCountry | `string` |
| Features | [UserAgentFeatures](#UserAgentFeatures) |
| GateID | `int` |
| InitializedAt | `int` |
| IsAffiliate | `bool` |
| IsDesktop | `bool` |
| IsMobile | `bool` |
| IsOpenJaw | `bool` |
| KnowEnglish | `bool` |
| Locale | `string` |
| Marker | `string` |
| Market | `string` |
| OriginCountry | `string` |
| Os | `string` |
| OsVersion | `string` |
| Passengers | [Passengers](#Passengers) |
| Random | `float` |
| ReferrerHost | `string` |
| SearchDepth | `int` |
| Segments | array([RouteSegment](#RouteSegment)) |
| TravelPayoutsAPI | `bool` |
| TripClass | `string` |
| UserAgentDevice | `string` |
| UserAgentType | `string` |
| UserIP | `string` |

#### UserAgentFeatures
| Field | Type |
|---|---|
| Assisted | `bool` |
| TopPlacement | `bool` |
| TourTickets | `bool` |


14 changes: 14 additions & 0 deletions test/real_world/real_docs/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"fmt"

"github.com/antonmedv/expr/docgen"
"github.com/antonmedv/expr/test/real_world"
)

func main() {
doc := docgen.CreateDoc(real_world.NewEnv())

fmt.Println(doc.Markdown())
}
2 changes: 2 additions & 0 deletions test/real_world/real_world.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package real_world

//go:generate sh -c "go run ./real_docs/generate.go > README.md"

type DirectFlightsDays struct {
Start string
Days string
Expand Down

0 comments on commit 4175464

Please sign in to comment.