Documentation ¶
Index ¶
- Variables
- func BinID(binStr string) (int, error)
- func Bins() (map[string]*bins.Bin, error)
- func Execute()
- func FatalUsage(cmd *cobra.Command, v ...interface{})
- func JSON(v interface{})
- func MessageID(messageStr string) (int, error)
- func Messages() (map[string]*messages.Message, error)
- func MilestoneID(milestoneStr string) (int, error)
- func Milestones() (map[string]*milestones.Milestone, error)
- func Project() int
- func ProjectID(projectStr string) (int, error)
- func Projects() (map[string]*projects.Project, error)
- func TicketID(numberStr string) (int, error)
- func UserID(userStr string) (int, error)
- func Users() (map[string]*projects.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "lh", Short: "lh provides CLI access to the Lighthouse API http://help.lighthouseapp.com/kb/api", Long: `lh provides CLI access to the Lighthouse API http://help.lighthouseapp.com/kb/api Please specify your Lighthouse account name via -a, --account, the LH_ACCOUNT environment variable or the config file. If your Lighthouse URL is 'https://your-account-name.lighthouseapp.com' then your account name is 'your-account-name'. Lighthouse requires a valid API token or email/password to authenticate API requests. Please specify a Lighthouse API token via -t, --token, the LH_TOKEN environment variable or the config file. If you'd prefer to authenticate with an email/password, please specify it via -e, --email, the LH_EMAIL environment variable, -p, --password, the LH_PASSWORD environment variable or the config file. If the specified password has the form '@FILE', the password is instead read from FILE. Many subcommands work on resources that are Lighthouse project-specific. These commands require the project ID to be specified via -p, --project, the LH_PROJECT environment variable or the config file. The default config file is $HOME/.lh.yaml but can be overridden with --config. `, PersistentPreRun: func(cmd *cobra.Command, args []string) { account, token, email, password := viper.GetString("account"), viper.GetString("token"), viper.GetString("email"), viper.GetString("password") if len(account) == 0 { FatalUsage(cmd, "Please specify Lighthouse account name via -a, --account, LH_ACCOUNT or config file") } var client *http.Client if len(token) > 0 { client = lighthouse.NewClient(token) } else if len(email) > 0 && len(password) > 0 { pw := password if strings.HasPrefix(password, "@") && len(password) > 1 { buf, err := ioutil.ReadFile(password[1:]) if err != nil { FatalUsage(cmd, err) } pw = strings.TrimSpace(string(buf)) } client = lighthouse.NewClientBasicAuth(email, pw) } else { FatalUsage(cmd, "Please specify token or email & password") } service = lighthouse.NewService(account, client) }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func FatalUsage ¶ added in v0.2.0
func MilestoneID ¶ added in v0.2.0
func Milestones ¶ added in v0.2.0
func Milestones() (map[string]*milestones.Milestone, error)
Types ¶
This section is empty.
Source Files ¶
- create.go
- create_bin.go
- create_changeset.go
- create_message.go
- create_milestone.go
- create_project.go
- create_ticket.go
- delete.go
- delete_bin.go
- delete_changeset.go
- delete_message.go
- delete_milestone.go
- delete_project.go
- delete_ticket.go
- get.go
- get_bin.go
- get_changeset.go
- get_message.go
- get_milestone.go
- get_plan.go
- get_profile.go
- get_project.go
- get_ticket.go
- get_token.go
- get_user.go
- list.go
- list_bins.go
- list_changesets.go
- list_messages.go
- list_milestones.go
- list_projects.go
- list_tickets.go
- root.go
- update.go
- update_bin.go
- update_message.go
- update_milestone.go
- update_project.go
- update_ticket.go
- update_tickets.go
- update_user.go
Click to show internal directories.
Click to hide internal directories.