Documentation
¶
Index ¶
- Variables
- func BuildQueryString(base map[string]string, extra ...string) string
- func CreateOpenAPIFile(ctx context.Context, filePath string) (map[string]any, error)
- func DetectRepoFromGit() string
- func DoGet(ctx context.Context, httpClient Doer, baseURL, path string) (string, error)
- func ExtractRepoName(remoteURL string) string
- func GetNullifyToken(ctx context.Context, nullifyHost string, nullifyTokenFlag string, ...) (string, error)
- func ParseAuthConfig(ctx context.Context, configPath string) (*models.AuthConfig, error)
- func ParseAuthHeaders(ctx context.Context, authHeaders []string) (map[string]string, error)
- func ParseCustomerDomain(input string) (string, error)
- func ParseRepoFromGitConfig(path string) string
- func SanitizeNullifyHost(nullifyHost string) (string, error)
- type Doer
Constants ¶
This section is empty.
Variables ¶
var ErrNoToken = errors.New("no token detected")
Functions ¶
func BuildQueryString ¶ added in v0.12.0
BuildQueryString constructs a URL-encoded query string from a base map of parameters and optional key-value pairs. Extra pairs are specified as alternating key, value strings (e.g., "severity", "high", "status", "open"). Empty values are skipped.
func CreateOpenAPIFile ¶
func DetectRepoFromGit ¶ added in v0.12.0
func DetectRepoFromGit() string
DetectRepoFromGit reads the git remote origin URL from the nearest .git/config and extracts the repository name.
func DoGet ¶ added in v0.12.0
DoGet performs a GET request and returns the response body as a string. Returns an error if the request fails or the status code is not 2xx.
func ExtractRepoName ¶ added in v0.12.0
ExtractRepoName extracts the repository name from a git remote URL. Handles both SSH (git@github.com:org/repo.git) and HTTPS (https://github.com/org/repo.git) formats.
func GetNullifyToken ¶ added in v0.2.0
func ParseAuthConfig ¶ added in v0.11.0
ParseAuthConfig reads and parses an authentication configuration file
func ParseAuthHeaders ¶
func ParseCustomerDomain ¶ added in v0.12.0
ParseCustomerDomain accepts various forms of customer input and returns the canonical API host. Accepted formats:
- "acme" → "api.acme.nullify.ai"
- "acme.nullify.ai" → "api.acme.nullify.ai"
- "api.acme.nullify.ai" → "api.acme.nullify.ai"
func ParseRepoFromGitConfig ¶ added in v0.12.0
ParseRepoFromGitConfig extracts the repo name from a .git/config file.