social

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WeComProvider

type WeComProvider struct {
	CorpID  string
	AgentID string
	Secret  string
	// contains filtered or unexported fields
}

func NewWeComProvider

func NewWeComProvider(corpID, agentID, secret string) *WeComProvider

func (*WeComProvider) GenerateLoginURL

func (p *WeComProvider) GenerateLoginURL(redirectURI, state string) string

GenerateLoginURL constructs the QR Connect URL https://open.work.weixin.qq.com/wwopen/sso/qrConnect?appid=CORPID&agentid=AGENTID&redirect_uri=REDIRECT_URI&state=STATE

func (*WeComProvider) GetUserInfo

func (p *WeComProvider) GetUserInfo(code string) (userInfo *WeComUserInfo, err error)

GetUserInfo processes the callback code code and retrieves UserID

func (*WeComProvider) UpdateCircuitBreaker

func (p *WeComProvider) UpdateCircuitBreaker(maxRequests uint32, interval, timeout float64, ratio float64)

UpdateCircuitBreaker updates the circuit breaker settings

type WeComUserInfo

type WeComUserInfo struct {
	UserID string `json:"UserId"`
	OpenID string `json:"OpenId"` // Used if not part of corp
	Name   string `json:"name"`   // Often empty in initial auth, needs separate User Get
	Email  string `json:"email"`
}

Jump to

Keyboard shortcuts

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