glinstance

package
v1.111.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHostname = "gitlab.com"
	DefaultProtocol = "https"
	DefaultClientID = "41d48f9422ebd655dd9cf2947d6979681dfaddc6d0c56f7628f6ada59559af1e"
)

Variables

This section is empty.

Functions

func APIEndpoint

func APIEndpoint(hostname, protocol, apiHost, subfolder string) string

APIEndpoint returns the REST API endpoint prefix for a GitLab instance.

Parameters:

hostname: Base hostname (e.g., "example.com")
protocol: "http" or "https"
apiHost: (Deprecated) Alternate API hostname, may contain path for backward compat
subfolder: Subfolder path (e.g., "gitlab" for https://example.com/gitlab/)

Precedence: subfolder parameter > path in apiHost > none

func AuthEndpoint added in v1.111.0

func AuthEndpoint(hostname, protocol, subfolder string) string

AuthEndpoint returns the base URL used by GitLab authentication endpoints.

func ExtractSubfolder added in v1.87.0

func ExtractSubfolder(input string) (string, string)

ExtractSubfolder splits a hostname string into hostname and optional subfolder. Trims slashes from the subfolder result. Example: "example.com/gitlab/" → ("example.com", "gitlab")

func GraphQLEndpoint

func GraphQLEndpoint(hostname, protocol, apiHost, subfolder string) string

GraphQLEndpoint returns the GraphQL API endpoint prefix for a GitLab instance. Parameters match APIEndpoint for consistency.

func HostnameValidator

func HostnameValidator(v any) error

func IsSelfHosted

func IsSelfHosted(h string) bool

IsSelfHosted reports whether a non-normalized host name looks like a GitLab Self-Managed instance staging.gitlab.com is considered self-managed

func NormalizeHostname

func NormalizeHostname(h string) string

NormalizeHostname returns the canonical host name of a GitLab instance Note: GitLab does not allow subdomains on gitlab.com https://gitlab.com/gitlab-org/gitlab/-/issues/26703

func StripHostProtocol

func StripHostProtocol(h string) (string, string)

StripHostProtocol strips the url protocol and returns the hostname and the protocol

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL