reqOpts returns per-request options for authentication and context.
(ctx context.Context, token string)
| 64 | |
| 65 | // reqOpts returns per-request options for authentication and context. |
| 66 | func reqOpts(ctx context.Context, token string) []gitlab.RequestOptionFunc { |
| 67 | opts := []gitlab.RequestOptionFunc{gitlab.WithContext(ctx)} |
| 68 | if token != "" { |
| 69 | opts = append(opts, gitlab.WithToken(gitlab.OAuthToken, token)) |
| 70 | } |
| 71 | return opts |
| 72 | } |
| 73 | |
| 74 | // gitLabPID returns the full project path (owner/repo) for use as a pid. |
| 75 | // The library handles URL encoding internally. |
no test coverage detected