github

package
v0.2.52-rc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmailLookup = errors.New("failed to lookup email")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string) *Client

func (*Client) GetEmails

func (p *Client) GetEmails(ctx context.Context) ([]Email, error)

func (*Client) GetPrimaryEmail

func (p *Client) GetPrimaryEmail(ctx context.Context) (*Email, error)

func (*Client) GetUser

func (p *Client) GetUser(ctx context.Context) (*User, error)

func (*Client) IDToken

func (p *Client) IDToken(ctx context.Context) (*oidc.IDToken, error)

type Email

type Email struct {
	Email    string `json:"email"`
	Verified bool   `json:"verified"`
	Primary  bool   `json:"primary"`
}

type Provider

type Provider struct{}

func New

func New() *Provider

func (*Provider) AuthorizationURL

func (*Provider) AuthorizationURL(config *oauth2.Config, parameters *types.AuthorizationParamters) (string, error)

func (*Provider) CodeExchange

func (*Provider) CodeExchange(ctx context.Context, parameters *types.CodeExchangeParameters) (*oauth2.Token, *oidc.IDToken, error)

func (*Provider) Config

func (*Provider) Config(ctx context.Context, parameters *types.ConfigParameters) (*oauth2.Config, error)

type User

type User struct {
	Name      string `json:"name"`
	AvatarURL string `json:"avatar_url"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL