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.
synctv/internal/provider/provider.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)
}