Documentation
¶
Index ¶
Constants ¶
View Source
const ( // GITSuffix is the suffix used to terminate repo paths for git apis. GITSuffix = ".git" // APIMount is the prefix path for the api endpoints. APIMount = "api" // GITMount is the prefix path for the git endpoints. GITMount = "git" // ArtifactMount is the prefix path for the artifact endpoints ArtifactMount = "_artifacts" // ContainerRegistry is the prefix path for the container registry endpoints ContainerRegistry = "v2" )
Variables ¶
View Source
var WireSet = wire.NewSet(ProvideURLProvider)
WireSet provides a wire set for this package.
Functions ¶
Types ¶
type Provider ¶
type Provider interface {
// GetInternalAPIURL returns the internally reachable base url of the server.
// NOTE: url is guaranteed to not have any trailing '/'.
GetInternalAPIURL(ctx context.Context) string
// GenerateContainerGITCloneURL generates a URL that can be used by CI container builds to
// interact with Harness and clone a repo.
GenerateContainerGITCloneURL(ctx context.Context, repoPath string) string
// GenerateGITCloneURL generates the public git clone URL for the provided repo path.
// NOTE: url is guaranteed to not have any trailing '/'.
GenerateGITCloneURL(ctx context.Context, repoPath string) string
// GenerateCustomUIRepoURL returns the url for the UI screen of a repository.
GenerateCustomUIRepoURL(repoPath, custom string) string
// GenerateGITCloneSSHURL generates the public git clone URL for the provided repo path.
// NOTE: url is guaranteed to not have any trailing '/'.
GenerateGITCloneSSHURL(ctx context.Context, repoPath string) string
// GenerateUIRepoURL returns the url for the UI screen of a repository.
GenerateUIRepoURL(ctx context.Context, repoPath string) string
// GenerateUIPRURL returns the url for the UI screen of an existing pr.
GenerateUIPRURL(ctx context.Context, repoPath string, prID int64) string
// GenerateUICompareURL returns the url for the UI screen comparing two references.
GenerateUICompareURL(ctx context.Context, repoPath string, ref1 string, ref2 string) string
// GetAPIHostname returns the host for the api endpoint.
GetAPIHostname(ctx context.Context) string
// GenerateUIBuildURL returns the endpoint to use for viewing build executions.
GenerateUIBuildURL(ctx context.Context, repoPath, pipelineIdentifier string, seqNumber int64) string
// GetGITHostname returns the host for the git endpoint.
GetGITHostname(ctx context.Context) string
// GetAPIProto returns the proto for the API hostname
GetAPIProto(ctx context.Context) string
// GenerateRegistryURL return the container registry endpoint
GenerateRegistryURL(segments ...string) *url.URL
// RegistryURL returns the url for oci token endpoint
RegistryURL() string
}
Provider is an abstraction of a component that provides system related URLs. NOTE: Abstract to allow for custom implementation for more complex routing environments.
func NewProvider ¶
Click to show internal directories.
Click to hide internal directories.