Documentation ¶
Index ¶
- Variables
- type SocialiteProvider
- type SocialiteProviderGithubConfig
- type SocialiteProviderStatus
- type SocialiteProviderWechatConfig
- type SocialiteRepository
- func (r *SocialiteRepository) CreateSocialiteProvider(ctx context.Context, socialiteProvider SocialiteProvider) (savedSocialiteProvider SocialiteProvider, err error)
- func (r *SocialiteRepository) DeleteSocialiteProvider(ctx context.Context, socialiteProvider SocialiteProvider) (err error)
- func (r *SocialiteRepository) GetSocialiteProvider(ctx context.Context, id int64) (socialiteProvider SocialiteProvider, err error)
- func (r *SocialiteRepository) GetSocialiteProviderList(ctx context.Context, status SocialiteProviderStatus) (list []SocialiteProvider, err error)
- func (r *SocialiteRepository) SoftDeleteSocialiteProvider(ctx context.Context, socialiteProvider SocialiteProvider) (err error)
- type SocialiteService
- type SupportedSocialiteProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidSocialiteProvider = errors.New("invalid socialite provider")
)
Functions ¶
This section is empty.
Types ¶
type SocialiteProvider ¶
type SocialiteProvider struct { Id int64 `json:"id" db:"id"` Name string `json:"name" db:"name"` Provider SupportedSocialiteProvider `json:"provider" db:"provider"` Status SocialiteProviderStatus `json:"status" db:"status"` Config string `json:"config" db:"config"` DeletedAt sql.NullTime `json:"-" db:"deleted_at,omitempty"` CreatedAt time.Time `json:"-" db:"created_at"` UpdatedAt time.Time `json:"-" db:"updated_at"` }
func (*SocialiteProvider) GothProvider ¶
func (p *SocialiteProvider) GothProvider() (provider goth.Provider, err error)
type SocialiteProviderStatus ¶
type SocialiteProviderStatus int
const ( SOCIALITE_PROVIDER_STATUS_HIDDEN SocialiteProviderStatus = 0 SOCIALITE_PROVIDER_STATUS_NORMAL SocialiteProviderStatus = 1 )
type SocialiteProviderWechatConfig ¶
type SocialiteProviderWechatConfig struct { ClientId string `json:"client_id"` ClientSecret string `json:"client_secret"` RedirectURL string `json:"redirect_url"` Lang wechat.WechatLangType `json:"lang"` }
type SocialiteRepository ¶
type SocialiteRepository struct {
// contains filtered or unexported fields
}
func NewSocialiteRepository ¶
func NewSocialiteRepository(db *sql.DB) *SocialiteRepository
func (*SocialiteRepository) CreateSocialiteProvider ¶
func (r *SocialiteRepository) CreateSocialiteProvider( ctx context.Context, socialiteProvider SocialiteProvider, ) ( savedSocialiteProvider SocialiteProvider, err error, )
func (*SocialiteRepository) DeleteSocialiteProvider ¶
func (r *SocialiteRepository) DeleteSocialiteProvider( ctx context.Context, socialiteProvider SocialiteProvider, ) (err error)
func (*SocialiteRepository) GetSocialiteProvider ¶
func (r *SocialiteRepository) GetSocialiteProvider( ctx context.Context, id int64, ) ( socialiteProvider SocialiteProvider, err error, )
func (*SocialiteRepository) GetSocialiteProviderList ¶
func (r *SocialiteRepository) GetSocialiteProviderList(ctx context.Context, status SocialiteProviderStatus) (list []SocialiteProvider, err error)
func (*SocialiteRepository) SoftDeleteSocialiteProvider ¶
func (r *SocialiteRepository) SoftDeleteSocialiteProvider( ctx context.Context, socialiteProvider SocialiteProvider, ) (err error)
type SocialiteService ¶
type SocialiteService struct {
// contains filtered or unexported fields
}
func NewSocialiteService ¶
func NewSocialiteService(db *sql.DB) *SocialiteService
func (*SocialiteService) UseProviders ¶
func (s *SocialiteService) UseProviders(ctx context.Context) (err error)
type SupportedSocialiteProvider ¶
type SupportedSocialiteProvider string
const ( SUPPORTED_SOCIALITE_PROVIDER_WECHAT SupportedSocialiteProvider = "wechat" SUPPORTED_SOCIALITE_PROVIDER_GITHUB SupportedSocialiteProvider = "github" SUPPORTED_SOCIALITE_PROVIDER_APPLE SupportedSocialiteProvider = "apple" )
Click to show internal directories.
Click to hide internal directories.