Provides URL validation and normalization for HTTP, Git, and OCI URLs in a Go application.
// Source: https://github.com/kimdre/doco-cd | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package config
import (
"fmt"
"net/url"
"path/filepath"
"regexp"
"strings"
"github.com/google/go-containerregistry/pkg/name"
"github.com/kimdre/doco-cd/internal/common/validation"
)
// UrlValidator is the common interface that both GitUrl and OciUrl implement.
type UrlValidator interface {
Validate() error
}
// HttpUrl is a type for strings that represent plain HTTP or HTTPS URLs (e.g. for API endpoints).
type HttpUrl string
// GitUrl is a type for strings that represent Git repository URLs (http, https, ssh, git, file, or scp-style).
type GitUrl string
// OciUrl is a type f
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key