-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
165 changed files
with
25,461 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ | |
.glide/ | ||
.wercker/ | ||
bin/* | ||
*.sh | ||
*.bat |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ VERSION ?= $(shell git describe --tags) | |
PKG = github.com/yieldr/navitaire-ods | ||
PKGS = $(shell go list ./... | grep -v /vendor/ | grep -v /test) | ||
|
||
# SENTRY_DSN ?= "https://[email protected]/304990" | ||
|
||
LDFLAGS = "-s -w -X github.com/yieldr/navitaire-ods/pkg/version.Version=$(VERSION)" | ||
|
||
OS ?= darwin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,48 @@ | ||
# Yieldr - Navitaire ODS Flight Uploader | ||
# Yieldr - Navitaire New Skies® ODS | ||
|
||
Upload flight performance from [Navitaire New Skies](http://www.navitaire.com/p_new_skies.aspx) [Operational Data Store](http://www.navitaire.com/Styles/Images/PDFs/Data%20Store.pdf) to Yieldr. | ||
|
||
## Download | ||
|
||
Head over to the [releases](https://github.com/yieldr/navitaire-ods/releases) page and download a version appropriate for your operating system and architecture. | ||
|
||
``` | ||
curl -sSL -o navitaire-ods https://github.com/yieldr/navitaire-ods/releases/download/v0.0.1-alpha.3/navitaire-ods-linux-amd64 | ||
``` | ||
|
||
## Usage | ||
|
||
The `run` command queries the New Skies ODS database and uploads the flights to Yieldr using the [Yieldr API](https://api.yieldr.com/#272b3d39-2dfc-e7fe-7f65-f2cd4d0e841c). | ||
|
||
```bash | ||
navitaire-ods run \ | ||
--api \ | ||
--api-addr="<account>.yieldr.com" \ | ||
--api-client-id=<client-id> \ | ||
--api-client-secret=<client-secret> \ | ||
--api-project-id=<project-id> \ | ||
--db="sqlserver" \ | ||
--db-addr="localhost:1234" \ | ||
--db-name="NS34ODS" \ | ||
--db-user=<username> \ | ||
--db-pass=<password> \ | ||
--db-query="" \ # use the default query, see below | ||
--db-query-args=<carrier-code> | ||
``` | ||
|
||
Flags can alternatively be replace with environment variables. The convention is `YIELDR_` followed by the flag name in capital letters with dashes (`-`) replaced by undescores (`_`). For example the `--api-addr` flag can be defined as the `YIELDR_API_ADDR` environment variable. | ||
|
||
### SQL Query | ||
|
||
An [example SQL query](pkg/navitaire/ods/query.sql) is supplied for convenience, but in most cases you might want to customise it to match your use case. | ||
|
||
## Yieldr API | ||
|
||
To find your `client_id` and `client_secret` you will need to create a [Yieldr API Integration](https://help.yieldr.com/yieldr-api/section-heading/step-2-integrate-with-the-yieldr-api). | ||
|
||
## SFTP | ||
|
||
We plan to add support for uploading files using SFTP. As of this writing this is not supported, but might become available in the future. | ||
|
||
For more information on the `run` command, check the reference [documentation](doc/navitaire-ods_run.md). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright © 2018 Yieldr | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/spf13/cobra/doc" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
var cmdDoc = &cobra.Command{ | ||
Use: "doc", | ||
Short: "Generate cli documentation", | ||
Run: runDoc, | ||
} | ||
|
||
func runDoc(cmd *cobra.Command, args []string) { | ||
dir, _ := cmd.Flags().GetString("dir") | ||
format, _ := cmd.Flags().GetString("format") | ||
|
||
var err error | ||
|
||
switch format { | ||
case "markdown": | ||
err = doc.GenMarkdownTree(cmdRoot, dir) | ||
case "rest": | ||
err = doc.GenReSTTree(cmdRoot, dir) | ||
case "man": | ||
err = doc.GenManTree(cmdRoot, &doc.GenManHeader{}, dir) | ||
} | ||
|
||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
func init() { | ||
cmdRoot.AddCommand(cmdDoc) | ||
cmdDoc.Flags().String("dir", "doc", "Directory in which to generate documentation") | ||
cmdDoc.Flags().String("format", "markdown", "Format in which to generate documentation") | ||
viper.BindPFlag("dir", cmdRun.Flags().Lookup("dir")) | ||
viper.BindPFlag("format", cmdRun.Flags().Lookup("format")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.