glinstance

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIEndpoint

func APIEndpoint(hostname, protocol string) string

APIEndpoint returns the REST API endpoint prefix for a GitLab instance :)

func Default

func Default() string

Default returns the host name of the default GitLab instance

func DefaultProtocol

func DefaultProtocol() string

DefaultProtocol returns the protocol of the default GitLab instance

func GraphQLEndpoint

func GraphQLEndpoint(hostname, protocol string) string

GraphQLEndpoint returns the GraphQL API endpoint prefix for a GitLab instance :)

func HostnameValidator

func HostnameValidator(v interface{}) error

func IsSelfHosted

func IsSelfHosted(h string) bool

IsSelfHosted reports whether a non-normalized host name looks like a Self-hosted GitLab instance

func NormalizeHostname

func NormalizeHostname(h string) string

NormalizeHostname returns the canonical host name of a GitLab instance Taking cover in case GitLab allows subdomains on gitlab.com https://gitlab.com/gitlab-org/gitlab/-/issues/26703

func OverridableDefault

func OverridableDefault() string

OverridableDefault is like Default, except it is overridable by the GITLAB_HOST environment variable

func OverridableDefaultProtocol

func OverridableDefaultProtocol() string

OverridableDefaultProtocol is like DefaultProtocol, except it is overridable by the protocol found in the value of the GITLAB_HOST environment variable if a fully qualified URL is given as value

func OverrideDefault

func OverrideDefault(newhost string)

OverrideDefault overrides the value returned from OverridableDefault. This should only ever be called from the main runtime path, not tests.

func OverrideDefaultProtocol

func OverrideDefaultProtocol(newProtocol string)

OverrideDefaultProtocol overrides the value returned from OverridableDefaultProtocol. This should only ever be called from the main runtime path, not tests.

func StripHostProtocol

func StripHostProtocol(h string) (hostname, protocol 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