{"modulePath":"github.com/deepsourcelabs/cli","version":"v0.10.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Variables\n\n```go\nvar (\n\tAnalyzersData    DeepSourceAnalyzersData\n\tTransformersData DeepSourceTransformersData\n)\n```\n\n```go\nvar (\n\tDEEPSOURCE_AUDIENCE = \"DeepSource\"\n\tALLOWED_PROVIDERS   = map[string]bool{\n\t\t\"github-actions\": true,\n\t}\n)\n```\n\n## Functions\n\n```go\nfunc ConfirmFromUser(msg, helpText string) (bool, error)\n```\nUsed for (Yes/No) questions\n\n```go\nfunc Cyan(format string, a ...interface{}) string\n```\n\n```go\nfunc ExactArgs(count int) cobra.PositionalArgs\n```\nValidates if the number of args passed to a command is exactly same as that required\n\n```go\nfunc ExchangeOIDCTokenForTempDSN(oidcToken, dsEndpoint, provider string) (string, error)\n```\nExchangeOIDCTokenForTempDSN exchanges the OIDC token for a temporary DSN. It sends the OIDC token to the respective DeepSource API endpoint and returns the temp DSN as string.\n\n```go\nfunc FetchOIDCTokenFromProvider(requestId, requestUrl string) (string, error)\n```\nFetchOIDCTokenFromProvider fetches the OIDC token from the OIDC token provider. It takes the request ID and the request URL as input and returns the OIDC token as a string.\n\n```go\nfunc GetAnalyzersAndTransformersData(ctx context.Context, deepsource deepsource.Client) (err error)\n```\nGet the list of all the supported analyzers and transformers with their corresponding data like shortcode, metaschema etc.\n\n```go\nfunc GetDSNFromOIDC(requestId, requestUrl, dsEndpoint, provider string) (string, error)\n```\n\n```go\nfunc GetSingleLineInput(msg, helpText string) (string, error)\n```\nUsed for Single Line Text Input Being used for getting \"Import root\" of user for configuring meta of Go analyzer\n\n```go\nfunc ListRemotes() (map[string][]string, error)\n```\nReturns a map of remotes to their urls { \"origin\":\\[\"reponame\",\"owner\",\"provider\"]} { \"upstream\":\\[\"reponame\",\"owner\",\"provider\"]}\n\n```go\nfunc MaxNArgs(count int) cobra.PositionalArgs\n```\n\n```go\nfunc NoArgs(cmd *cobra.Command, args []string) error\n```\nValidates if there is any arg passed to a command which doesn't require any\n\n```go\nfunc RepoArgumentResolver(arg string) ([]string, error)\n```\nUtility to parse the --repo flag\n\n```go\nfunc SelectFromMultipleOptions(msg, helpText string, options []string) ([]string, error)\n```\nUsed for multiple inputs from the displayed options Example: ? Which languages/tools does your project use? \u003e \\[ ]  Shell\n\n\t[ ]  Rust\n\t[ ]  Test Coverage\n\t[ ]  Python\n\t[ ]  Go\n\n```go\nfunc SelectFromOptions(msg, helpText string, opts []string) (string, error)\n```\nUsed for Single Option Selection from Multiple Options Being used for selecting Java version for configuring meta of Java analyzer \u003e \\* 1\n\n  - 2\n  - 3\n\n```go\nfunc Yellow(format string, a ...interface{}) string\n```\n\n## Types\n\n```go\ntype DeepSourceAnalyzersData struct {\n\tAnalyzerNames      []string\n\tAnalyzerShortcodes []string\n\tAnalyzersMap       map[string]string // Map for {analyzer name : shortcode}\n\tAnalyzersMeta      []string\n\tAnalyzersMetaMap   map[string]string // Map for {analyzer name: analyzer meta-schema}\n}\n```\n\n```go\ntype DeepSourceTransformersData struct {\n\tTransformerNames      []string\n\tTransformerShortcodes []string\n\tTransformerMap        map[string]string // Map for {transformer name:shortcode}\n}\n```\n\n```go\ntype RemoteData struct {\n\tOwner       string\n\tRepoName    string\n\tVCSProvider string\n}\n```\n\n```go\nfunc ResolveRemote(repoArg string) (*RemoteData, error)\n```\n\n","path":"github.com/deepsourcelabs/cli/utils","name":"utils","synopsis":"","isRedistributable":true}
