cmd

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DATA_DIR string = "templates/"

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "facebookLogin",
	Short: "facebookLogin is a standalone proxy to make request to facebook graphAPI on the user node.",
	Long: `facebookLogin is a standalone proxy to make request to facebook graphAPI on the user node.

You can use the program to run server a side proxy to query simple data about users who authorized your app.
This is ideal to quickly deploy a server-side login flow if an official SDK isn't available for you.`,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		if len(facebookSettings.AppID) == 0 {
			return fmt.Errorf("AppID is missing.")
		}
		if len(facebookSettings.AppSecret) == 0 {
			return fmt.Errorf("AppSecret is missing.")
		}
		return nil
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		fbApp := handler.CreateFacebookClient(facebookSettings.AppID, facebookSettings.AppSecret, facebookSettings.RedirectUri, facebookSettings.EnableAppsecretProof)
		env := &handler.Env{fbApp}
		return runRoot(env)
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type FacebookSettings

type FacebookSettings struct {
	AppID                string
	AppSecret            string
	RedirectUri          string
	EnableAppsecretProof bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL