Documentation ¶
Index ¶
Constants ¶
View Source
const RootConfigKey configKey = "example-config"
Variables ¶
View Source
var AttributesExampleCmd = &cobra.Command{ Use: "attributes", Short: "Example usage for attributes service", RunE: func(cmd *cobra.Command, args []string) error { examplesConfig := *(cmd.Context().Value(RootConfigKey).(*ExampleConfig)) return attributesExample(&examplesConfig) }, }
View Source
var AuthorizationExampleCmd = &cobra.Command{ Use: "authorization", Short: "Example usage for authorization service", RunE: func(cmd *cobra.Command, args []string) error { examplesConfig := *(cmd.Context().Value(RootConfigKey).(*ExampleConfig)) return authorizationExamples(&examplesConfig) }, }
View Source
var ExamplesCmd = &cobra.Command{ Use: "examples", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { platformEndpoint, err := cmd.Parent().PersistentFlags().GetString("platformEndpoint") if err != nil { return err } config := &ExampleConfig{ PlatformEndpoint: platformEndpoint, } ctx := context.WithValue(cmd.Context(), RootConfigKey, config) cmd.SetContext(ctx) return nil }, }
View Source
var GenDocsCmd = &cobra.Command{ Use: "docs", Short: "Generates docs for the example commands", RunE: func(cmd *cobra.Command, args []string) error { println("Generating Docs") err := doc.GenMarkdownTree(ExamplesCmd, "./docs") return err }, }
Functions ¶
Types ¶
type ExampleConfig ¶
type ExampleConfig struct {
PlatformEndpoint string
}
Click to show internal directories.
Click to hide internal directories.