Documentation
¶
Index ¶
- Constants
- func FetchFromEndpoint(ctx context.Context, params RequestParameters) (string, error)
- func GetTokenValueFromLocalSecret(ctx context.Context, client client.Client, m resource.Managed, ...) (*string, error)
- func GetTokenValueFromSecret(ctx context.Context, client client.Client, m resource.Managed, ...) (*string, error)
- func NewClient(c Config) *gitlab.Client
- func ResolvePublicJobsSetting(publicBuilds, publicJobs *bool) (*bool, bool)
- func TestCreateLocalSecretKeySelector(name, key string) *xpv1.LocalSecretKeySelector
- func TestCreateLocalSecretReference(name string) *xpv1.LocalSecretReference
- func TestCreateSecretKeySelector(name, key string) *xpv1.SecretKeySelector
- func TestCreateSecretReference(name string) *xpv1.SecretReference
- type AuthParameters
- type BasicAuth
- type Config
- func GetConfig(ctx context.Context, c client.Client, mg resource.Managed) (*Config, error)
- func UseLegacyProviderConfig(ctx context.Context, c client.Client, mg resource.LegacyManaged) (*Config, error)
- func UseProvicerConfig(ctx context.Context, c client.Client, mg resource.ModernManaged) (*Config, error)
- type RequestParameters
Constants ¶
const ( ErrSecretNotFound = "Cannot find referenced secret" ErrSecretKeyNotFound = "Cannot find key in referenced secret" ErrSecretSelectorNil = "Secret selector is nil" )
Variables ¶
This section is empty.
Functions ¶
func FetchFromEndpoint ¶ added in v0.17.0
func FetchFromEndpoint(ctx context.Context, params RequestParameters) (string, error)
FetchFromEndpoint fetches content from the provided endpoint URL using the provided authentication details. It supports: - Unauthenticated requests (Auth nil or all auth params nil) - Basic authentication (username + password) - Bearer token authentication (token) Token authentication takes precedence over basic auth if both are provided.
func GetTokenValueFromSecret ¶
func NewClient ¶
NewClient creates new Gitlab Client with provided Gitlab Configurations/Credentials.
func ResolvePublicJobsSetting ¶
ResolvePublicJobsSetting determines the effective publicJobs value prioritizing publicJobs over the deprecated publicBuilds field. Returns the resolved value and whether the deprecated publicBuilds field was used.
func TestCreateLocalSecretKeySelector ¶
func TestCreateLocalSecretKeySelector(name, key string) *xpv1.LocalSecretKeySelector
CreateLocalSecretKeySelector creates a LocalSecretKeySelector for testing
func TestCreateLocalSecretReference ¶
func TestCreateLocalSecretReference(name string) *xpv1.LocalSecretReference
CreateLocalSecretKeySelector creates a LocalSecretKeySelector for testing
func TestCreateSecretKeySelector ¶
func TestCreateSecretKeySelector(name, key string) *xpv1.SecretKeySelector
CreateSecretKeySelector creates a SecretKeySelector for testing
func TestCreateSecretReference ¶
func TestCreateSecretReference(name string) *xpv1.SecretReference
CreateSecretKeySelector creates a SecretKeySelector for testing
Types ¶
type AuthParameters ¶ added in v0.17.0
AuthParameters holds authentication details for HTTP requests
type BasicAuth ¶
BasicAuth is the expected struct that can be passed in the Config.Token field to add support for BasicAuth AuthMethod
type Config ¶
Config provides gitlab configurations for the Gitlab client
func GetConfig ¶
GetConfig constructs a Config that can be used to authenticate to Gitlab API by the Gitlab Go client
func UseLegacyProviderConfig ¶
func UseLegacyProviderConfig(ctx context.Context, c client.Client, mg resource.LegacyManaged) (*Config, error)
UseProviderConfig to produce a config that can be used to authenticate to Gitlab.
func UseProvicerConfig ¶
type RequestParameters ¶ added in v0.17.0
type RequestParameters struct {
Auth *AuthParameters
EndpointURL string
Timeout *time.Duration
MaxSize *int64
Retries *int
}
RequestParameters holds parameters for making HTTP requests