Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Deprecate module and its exported client type and constructor functions
Browse files Browse the repository at this point in the history
This change set deprecates this module and its exported `Client` type
and its constructor functions: `NewClient`, `NewBasicAuthClient`,
`NewJobClient` and `NewOAuthClient`.

Use the new module at https://gitlab.com/gitlab-org/client-go
  • Loading branch information
timofurrer committed Dec 5, 2024
1 parent 098437b commit 2526565
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const (
var ErrNotFound = errors.New("404 Not Found")

// A Client manages communication with the GitLab API.
//
// Deprecated: use gitlab.com/gitlab-org/api/client-go instead.
// See https://gitlab.com/gitlab-org/api/client-go
//
// This package is completely frozen, nothing will be added, removed or changed.
type Client struct {
// HTTP client used to communicate with the API.
client *retryablehttp.Client
Expand Down Expand Up @@ -258,6 +263,11 @@ type RateLimiter interface {

// NewClient returns a new GitLab API client. To use API methods which require
// authentication, provide a valid private or personal token.
//
// Deprecated: This module has been migrated to gitlab.com/gitlab-org/api/client-go.
// See https://gitlab.com/gitlab-org/api/client-go
//
// This package is completely frozen, nothing will be added, removed or changed.
func NewClient(token string, options ...ClientOptionFunc) (*Client, error) {
client, err := newClient(options...)
if err != nil {
Expand All @@ -270,6 +280,11 @@ func NewClient(token string, options ...ClientOptionFunc) (*Client, error) {

// NewBasicAuthClient returns a new GitLab API client. To use API methods which
// require authentication, provide a valid username and password.
//
// Deprecated: This module has been migrated to gitlab.com/gitlab-org/api/client-go.
// See https://gitlab.com/gitlab-org/api/client-go
//
// This package is completely frozen, nothing will be added, removed or changed.
func NewBasicAuthClient(username, password string, options ...ClientOptionFunc) (*Client, error) {
client, err := newClient(options...)
if err != nil {
Expand All @@ -285,6 +300,11 @@ func NewBasicAuthClient(username, password string, options ...ClientOptionFunc)

// NewJobClient returns a new GitLab API client. To use API methods which require
// authentication, provide a valid job token.
//
// Deprecated: This module has been migrated to gitlab.com/gitlab-org/api/client-go.
// See https://gitlab.com/gitlab-org/api/client-go
//
// This package is completely frozen, nothing will be added, removed or changed.
func NewJobClient(token string, options ...ClientOptionFunc) (*Client, error) {
client, err := newClient(options...)
if err != nil {
Expand All @@ -297,6 +317,11 @@ func NewJobClient(token string, options ...ClientOptionFunc) (*Client, error) {

// NewOAuthClient returns a new GitLab API client. To use API methods which
// require authentication, provide a valid oauth token.
//
// Deprecated: This module has been migrated to gitlab.com/gitlab-org/api/client-go.
// See https://gitlab.com/gitlab-org/api/client-go
//
// This package is completely frozen, nothing will be added, removed or changed.
func NewOAuthClient(token string, options ...ClientOptionFunc) (*Client, error) {
client, err := newClient(options...)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Deprecated: This module has been migrated to gitlab.com/gitlab-org/api/client-go. See https://gitlab.com/gitlab-org/api/client-go
module github.com/xanzy/go-gitlab

go 1.19
Expand Down

0 comments on commit 2526565

Please sign in to comment.