socialite

package
v0.0.0-...-fc827b4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 SocialiteProviderGithubConfig

type SocialiteProviderGithubConfig struct {
	ClientKey   string   `json:"client_key"`
	Secret      string   `json:"secret"`
	CallbackURL string   `json:"callback_url"`
	Scopes      []string `json:"scopes"`
}

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"
)

Jump to

Keyboard shortcuts

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