Documentation
¶
Overview ¶
Package glctx provides utilities for storing and retrieving GitLab API clients from Go contexts. This allows GitLab clients to be passed through request processing pipelines without explicit parameter passing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoClient = errors.New("gitlab client not found in context")
ErrNoClient is the error returned when no GitLab client is found in the context.
Functions ¶
func Client ¶
Client retrieves the GitLab client from the provided context. It returns the client and an error indicating whether a valid client was found. If an error is set on the context with WithError, it returns that error instead of the client. If no client exists in the context or the client is nil, it returns ErrNoClient.
func WithClient ¶
WithClient returns a new context that carries the provided GitLab client or error. The client can later be retrieved using the Client function.
Types ¶
This section is empty.