Documentation
¶
Index ¶
- Variables
- func Run(args []string, stdout io.Writer, stderr io.Writer) int
- type App
- type Color
- type DirectionsBicyclingCmd
- type DirectionsCmd
- type DirectionsCommon
- type DirectionsDrivingCmd
- type DirectionsElectrobikeCmd
- type DirectionsTransitCmd
- type DirectionsWalkingCmd
- type GlobalOptions
- type NearbyCmd
- type Root
- type SearchCmd
- type TipsCmd
- type VersionFlag
- type WeatherCmd
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "dev"
Version is the CLI version string (set by GoReleaser).
Functions ¶
Types ¶
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
Color renders ANSI color sequences.
type DirectionsBicyclingCmd ¶
type DirectionsBicyclingCmd struct {
DirectionsCommon `embed:""`
AlternativeRoute int `name:"alternative-route" help:"Number of alternative routes (1-3)."`
}
func (*DirectionsBicyclingCmd) Run ¶
func (c *DirectionsBicyclingCmd) Run(app *App) error
type DirectionsCmd ¶
type DirectionsCmd struct {
Driving DirectionsDrivingCmd `cmd:"" help:"Driving route."`
Walking DirectionsWalkingCmd `cmd:"" help:"Walking route."`
Bicycling DirectionsBicyclingCmd `cmd:"" help:"Bicycling route."`
Electrobike DirectionsElectrobikeCmd `cmd:"" help:"Electric-bike route."`
Transit DirectionsTransitCmd `cmd:"" help:"Public transit route."`
}
type DirectionsCommon ¶
type DirectionsDrivingCmd ¶
type DirectionsDrivingCmd struct {
DirectionsCommon `embed:""`
Strategy string `help:"Routing strategy code (default 32 — high-accuracy recommendation)."`
Waypoints string `help:"Up to 16 waypoints, semicolon-separated; each is 'lng,lat' or an address (geocoded if not coordinates)."`
Plate string `help:"Vehicle plate for restriction-aware routing."`
}
func (*DirectionsDrivingCmd) Run ¶
func (c *DirectionsDrivingCmd) Run(app *App) error
type DirectionsElectrobikeCmd ¶
type DirectionsElectrobikeCmd struct {
DirectionsCommon `embed:""`
AlternativeRoute int `name:"alternative-route" help:"Number of alternative routes (1-3)."`
}
func (*DirectionsElectrobikeCmd) Run ¶
func (c *DirectionsElectrobikeCmd) Run(app *App) error
type DirectionsTransitCmd ¶
type DirectionsTransitCmd struct {
DirectionsCommon `embed:""`
Strategy string `help:"Transit strategy code 0-8 (default 0 — recommended)."`
AlternativeRoute int `name:"alternative-route" help:"Number of alternative routes (1-10, default 5)."`
}
func (*DirectionsTransitCmd) Run ¶
func (c *DirectionsTransitCmd) Run(app *App) error
type DirectionsWalkingCmd ¶
type DirectionsWalkingCmd struct {
DirectionsCommon `embed:""`
AlternativeRoute int `name:"alternative-route" help:"Number of alternative routes (1-3)."`
}
func (*DirectionsWalkingCmd) Run ¶
func (c *DirectionsWalkingCmd) Run(app *App) error
type GlobalOptions ¶
type GlobalOptions struct {
Key string `help:"AMAP API key." env:"AMAP_API_KEY"`
BaseUrl string `help:"AMAP API base URL." env:"AMAP_BASE_URL" default:"https://restapi.amap.com"`
Timeout time.Duration `help:"HTTP timeout." default:"10s"`
JSON bool `help:"Output JSON."`
NoColor bool `help:"Disable color output."`
Verbose bool `help:"Verbose logging."`
Version VersionFlag `name:"version" help:"Print version and exit."`
}
type NearbyCmd ¶
type NearbyCmd struct {
Location string `help:"Center as 'longitude,latitude' or an address/place name (geocoded if not coordinates)." required:""`
Keywords string `help:"Search keywords."`
Types string `help:"POI type codes, pipe-separated."`
Radius int `help:"Search radius in meters (0-50000)." default:"5000"`
SortRule string `help:"Sort rule: distance or weight." default:"distance" enum:"distance,weight"`
Limit int `help:"Number of POIs to return (max 20)."`
MinCost float64 `name:"min-cost" help:"Minimum per-person cost; excludes POIs without cost data."`
MaxCost float64 `name:"max-cost" help:"Maximum per-person cost; excludes POIs without cost data."`
MinRating float64 `name:"min-rating" help:"Minimum rating 0-5; excludes POIs without rating data."`
}
type Root ¶
type Root struct {
Global GlobalOptions `embed:""`
Nearby NearbyCmd `cmd:"" help:"Search nearby places by location."`
Search SearchCmd `cmd:"" help:"Search places by keyword or type."`
Tips TipsCmd `cmd:"" help:"Query input suggestion tips by keyword."`
Weather WeatherCmd `cmd:"" help:"Query live or forecast weather by city."`
Directions DirectionsCmd `cmd:"" help:"Plan a route between origin and destination."`
}
Root defines the CLI command tree.
type SearchCmd ¶
type SearchCmd struct {
Keywords string `help:"Search keywords (required if --types is empty)."`
Types string `help:"POI type codes, pipe-separated (required if --keywords is empty)."`
Region string `help:"Region name, citycode, or adcode to bias search."`
Limit int `help:"Number of POIs to return (max 20)."`
MinCost float64 `name:"min-cost" help:"Minimum per-person cost; excludes POIs without cost data."`
MaxCost float64 `name:"max-cost" help:"Maximum per-person cost; excludes POIs without cost data."`
MinRating float64 `name:"min-rating" help:"Minimum rating 0-5; excludes POIs without rating data."`
}
type TipsCmd ¶
type TipsCmd struct {
Keywords string `help:"Search keywords." required:""`
Types string `help:"POI type codes (or names), pipe-separated."`
Location string `help:"Bias center as 'longitude,latitude' or an address (geocoded if not coordinates); only takes effect when --city is set."`
City string `help:"City name, citycode, or adcode to bias search."`
DataType string `name:"datatype" help:"Data type filter: all, poi, bus, busline (pipe-separated)." default:"all"`
}
type VersionFlag ¶
type VersionFlag string
VersionFlag prints the version and exits.
func (VersionFlag) BeforeApply ¶
BeforeApply prints the version and exits.
func (VersionFlag) Decode ¶
func (v VersionFlag) Decode(_ *kong.DecodeContext) error
Decode is a no-op for the boolean version flag.
func (VersionFlag) IsBool ¶
func (v VersionFlag) IsBool() bool
IsBool marks the version flag as boolean.
type WeatherCmd ¶
type WeatherCmd struct {
City string `help:"City adcode (6 digits) or name; names are resolved via geocoding." required:""`
Extensions string `help:"Weather type: base (live) or all (forecast)." default:"base" enum:"base,all"`
}
func (*WeatherCmd) Run ¶
func (c *WeatherCmd) Run(app *App) error
Click to show internal directories.
Click to hide internal directories.