gopaccountsdk

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

README

account

Go+ Account System

Documentation

Index

Constants

View Source
const (
	ProviderFacebook = "Facebook"
	ProviderTwitter  = "Twitter"
	ProviderGitHub   = "GitHub"
	ProviderWeChat   = "WeChat"
)

provider name

Variables

This section is empty.

Functions

func GetApplicationInfo

func GetApplicationInfo(appName string) (*casdoorsdk.Application, error)

获取当前应用

func GetCasdoorEndPoint added in v1.2.0

func GetCasdoorEndPoint() string

Types

type CasdoorConfig

type CasdoorConfig struct {
	// contains filtered or unexported fields
}

func CasdoorConfigInit

func CasdoorConfigInit() *CasdoorConfig

type GopAccountClient

type GopAccountClient struct {
	AccessToken string
	Claim       *casdoorsdk.Claims
}

Casdoor user session

func GetClient

func GetClient(token string) (*GopAccountClient, error)

func (GopAccountClient) GetProviderBindStatus

func (c GopAccountClient) GetProviderBindStatus() ProviderBindsStatus

Get Current User Provider binding status

func (*GopAccountClient) GetProviderWeChatQRCode added in v1.2.0

func (c *GopAccountClient) GetProviderWeChatQRCode(providerId string) (qrData, tickt string, err error)

func (*GopAccountClient) GetProviders added in v1.2.0

func (c *GopAccountClient) GetProviders() []*casdoorsdk.ProviderItem

get current user application providers

func (GopAccountClient) GetUser

func (c GopAccountClient) GetUser() (*casdoorsdk.User, error)

func (GopAccountClient) GetUserSimple

func (c GopAccountClient) GetUserSimple() *UserSimple

Get UserInfo from access token

func (p GopAccountClient) UnLink(provider string) bool

Unbind provider

providerName: lookup provider.go

type ProviderBindsStatus

type ProviderBindsStatus struct {
	Twitter  bool `json:"Twitter"`
	Github   bool `json:"Github"`
	Facebook bool `json:"Facebook"`
	Wechat   bool `json:"WeChat"`
}

Provider binding status

type UserSimple

type UserSimple struct {
	Id       string
	Name     string
	Password string
	Avatar   string
}

simple user

Jump to

Keyboard shortcuts

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