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
547 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(opt Oauth2Option)
Provider() OAuth2Provider
}
type RegistSetting interface {
RegistSetting(group string)
}
type Interface interface {
Provider
NewAuthURL(ctx context.Context, state string) (string, error)
GetUserInfo(ctx context.Context, code string) (*UserInfo, error)
}