mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
532 B
Go
34 lines
532 B
Go
package provider
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type OAuth2Provider = string
|
|
|
|
type UserInfo struct {
|
|
Username string
|
|
ProviderUserID string
|
|
}
|
|
|
|
type Oauth2Option struct {
|
|
ClientID string
|
|
ClientSecret string
|
|
RedirectURL string
|
|
}
|
|
|
|
type Provider interface {
|
|
Init(Oauth2Option)
|
|
Provider() OAuth2Provider
|
|
}
|
|
|
|
type ProviderRegistSetting interface {
|
|
RegistSetting(group string)
|
|
}
|
|
|
|
type Interface interface {
|
|
Provider
|
|
NewAuthURL(context.Context, string) (string, error)
|
|
GetUserInfo(context.Context, string) (*UserInfo, error)
|
|
}
|