{"modulePath":"github.com/simon-fredrich/function-gitlab-importer","version":"v0.3.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitlabclient\n\nPackage gitlabclient provides utilities for creating and configuring a GitLab API client. It retrieves the GitLab personal access token from the environment variable \\`GITLAB\\_API\\_KEY\\` and determines the GitLab BaseURL from either the provided input or environment variables. If no BaseURL is specified, it defaults to \\`[https://gitlab.com/](https://gitlab.com/)\\`.\n\nTypical usage:\n\n\tclient, err := gitlabclient.LoadClient(input)\n\tif err != nil {\n\t    // handle error\n\t}\n\nThe package relies on:\n\n  - github.com/simon-fredrich/function-gitlab-importer/input/v1beta1 for input structure\n  - gitlab.com/gitlab-org/api/client-go for GitLab API interactions\n  - github.com/crossplane/function-sdk-go/errors for error handling\n\nThis package is intended for use in a Crossplane Composition Function.\n\n## Functions\n\n```go\nfunc LoadClient(in *v1beta1.Input) (*gitlab.Client, error)\n```\nLoadClient initializes and returns a GitLab API client for use in Crossplane functions. It retrieves the GitLab personal access token from the environment variable \\`GITLAB\\_API\\_KEY\\`. If the token is missing, an error is returned.\n\nThe GitLab BaseURL is resolved in the following order:\n\n 1. From the provided Crossplane function input (\\`in.BaseURL\\`).\n 2. From the environment variable \\`GITLAB\\_URL\\`.\n 3. Defaults to \\`[https://gitlab.com/](https://gitlab.com/)\\` if neither is provided.\n\nThe function then creates a new GitLab client using the token and the resolved BaseURL, appending \\`/api/v4\\` to the URL.\n\nReturns:\n\n  - A configured \\*gitlab.Client instance if successful.\n  - An error if the token is missing or the client cannot be created.\n\nThis helper is designed for Crossplane function implementations that need to interact with the GitLab API in a dynamic and configurable way.\n\n","path":"github.com/simon-fredrich/function-gitlab-importer/internal/gitlabclient","name":"gitlabclient","synopsis":"Package gitlabclient provides utilities for creating and configuring a GitLab API client.","isRedistributable":true}
