Documentation
¶
Index ¶
- Constants
- func NormalizeBaseURL(raw string) string
- func RedirectURL(port int) string
- func TokenExpiry(now time.Time, token *TokenResponse) time.Time
- type AuthClient
- func (c *AuthClient) ExchangeCodeForTokens(ctx context.Context, ...) (*TokenResponse, error)
- func (c *AuthClient) FetchDirectAccess(ctx context.Context, baseURL, token string) (*DirectAccessResponse, error)
- func (c *AuthClient) GenerateAuthURL(baseURL, clientID, redirectURI, state string, pkce *PKCECodes) (string, error)
- func (c *AuthClient) GetCurrentUser(ctx context.Context, baseURL, token string) (*User, error)
- func (c *AuthClient) GetPersonalAccessTokenSelf(ctx context.Context, baseURL, token string) (*PersonalAccessTokenSelf, error)
- func (c *AuthClient) RefreshTokens(ctx context.Context, baseURL, clientID, clientSecret, refreshToken string) (*TokenResponse, error)
- type DirectAccessResponse
- type DiscoveredModel
- type ModelDetails
- type OAuthResult
- type OAuthServer
- type PKCECodes
- type PersonalAccessTokenSelf
- type TokenResponse
- type User
Constants ¶
View Source
const ( DefaultBaseURL = "https://gitlab.com" DefaultCallbackPort = 17171 )
Variables ¶
This section is empty.
Functions ¶
func NormalizeBaseURL ¶
func RedirectURL ¶
func TokenExpiry ¶
func TokenExpiry(now time.Time, token *TokenResponse) time.Time
Types ¶
type AuthClient ¶
type AuthClient struct {
// contains filtered or unexported fields
}
func NewAuthClient ¶
func NewAuthClient(cfg *config.Config) *AuthClient
func (*AuthClient) ExchangeCodeForTokens ¶
func (c *AuthClient) ExchangeCodeForTokens(ctx context.Context, baseURL, clientID, clientSecret, redirectURI, code, codeVerifier string) (*TokenResponse, error)
func (*AuthClient) FetchDirectAccess ¶
func (c *AuthClient) FetchDirectAccess(ctx context.Context, baseURL, token string) (*DirectAccessResponse, error)
func (*AuthClient) GenerateAuthURL ¶
func (c *AuthClient) GenerateAuthURL(baseURL, clientID, redirectURI, state string, pkce *PKCECodes) (string, error)
func (*AuthClient) GetCurrentUser ¶
func (*AuthClient) GetPersonalAccessTokenSelf ¶
func (c *AuthClient) GetPersonalAccessTokenSelf(ctx context.Context, baseURL, token string) (*PersonalAccessTokenSelf, error)
func (*AuthClient) RefreshTokens ¶
func (c *AuthClient) RefreshTokens(ctx context.Context, baseURL, clientID, clientSecret, refreshToken string) (*TokenResponse, error)
type DirectAccessResponse ¶
type DiscoveredModel ¶
func ExtractDiscoveredModels ¶
func ExtractDiscoveredModels(metadata map[string]any) []DiscoveredModel
type ModelDetails ¶
type OAuthResult ¶
type OAuthServer ¶
type OAuthServer struct {
// contains filtered or unexported fields
}
func NewOAuthServer ¶
func NewOAuthServer(port int) *OAuthServer
func (*OAuthServer) Start ¶
func (s *OAuthServer) Start() error
func (*OAuthServer) WaitForCallback ¶
func (s *OAuthServer) WaitForCallback(timeout time.Duration) (*OAuthResult, error)
type PKCECodes ¶
func GeneratePKCECodes ¶
type PersonalAccessTokenSelf ¶
type TokenResponse ¶
Click to show internal directories.
Click to hide internal directories.