Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CLICmd = &cobra.Command{ Use: "cli", Short: "Interact with a running Gravity server", PersistentPreRun: func(cmd *cobra.Command, args []string) { url, err := url.Parse(apiUrl) if err != nil { logger.Error("failed to parse API URL", zap.Error(err)) return } config := api.NewConfiguration() config.Host = url.Host config.Scheme = url.Scheme if url.Scheme == "unix" { config.Scheme = "http" config.Host = "socket" config.HTTPClient = &http.Client{ Transport: &http.Transport{ DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { return net.Dial("unix", url.Path) }, }, } } if apiToken != "" { config.AddDefaultHeader("Authorization", fmt.Sprintf("Bearer %s", apiToken)) } apiClient = api.NewAPIClient(config) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.