service

package
v0.0.0-...-73e4776 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	USER_API        = "https://api.github.com/user"
	USER_EMAILS_API = "https://api.github.com/user/emails"
	USER_ORGS_API   = "https://api.github.com/user/orgs"
)
View Source
const (
	ClientIDKey     = "client_id"
	ClientSecretKey = "client_secret"
	RedirectURLKey  = "redirect_uri"
	CodeKey         = "code"
	ScopeKey        = "scope"
)

Variables

This section is empty.

Functions

func Get

func Get(accessToken *string, URL string) (*http.Response, error)

Types

type GithubOauthConfig

type GithubOauthConfig struct {
	ClientID     string
	ClientSecret string
	RedirectURL  string // Authorization callback URL
}

type OauthAuthorizeURLs

type OauthAuthorizeURLs struct {
	UserInfoURL   string
	UserEmailsURL string
	UserOrgsURL   string
}

type OauthServ

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

func MustGetOauthServ

func MustGetOauthServ(
	tmpl *template.Template,
	config *GithubOauthConfig,
) *OauthServ

func (*OauthServ) GetUserEmails

func (o *OauthServ) GetUserEmails(w http.ResponseWriter, r *http.Request)

func (*OauthServ) GetUserInfo

func (o *OauthServ) GetUserInfo(w http.ResponseWriter, r *http.Request)

func (*OauthServ) GetUserOrgs

func (o *OauthServ) GetUserOrgs(w http.ResponseWriter, r *http.Request)

func (*OauthServ) HomePage

func (o *OauthServ) HomePage(w http.ResponseWriter, r *http.Request)

type RedirectURLType

type RedirectURLType string
const (
	USER_INFO   RedirectURLType = "info"
	USER_EMAILS RedirectURLType = "emails"
	USER_ORGS   RedirectURLType = "orgs"
)

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	Scope       string `json:"scope"`
}

Jump to

Keyboard shortcuts

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