openPlatform

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapUserConfig

func MapUserConfig(userConfig *UserConfig) (*object.HashMap, error)

Types

type Http added in v3.0.40

type Http struct {
	Timeout   float64
	BaseURI   string
	ProxyURI  string
	Transport http.RoundTripper
}

type Log

type Log struct {
	Driver contract.LoggerInterface
	Level  string
	File   string
	Error  string
	ENV    string
	Stdout bool
}

type OAuth

type OAuth struct {
	Callback string
	Scopes   []string
}

type OpenPlatform

type OpenPlatform struct {
	*kernel.ServiceContainer

	Base         *base.Client
	VerifyTicket *auth.VerifyTicket
	AccessToken  *auth.AccessToken
	Server       *server.Guard
	Encryptor    *kernel.Encryptor

	CodeTemplate *codeTemplate.Client
	Component    *component.Client

	Config *kernel.Config

	Logger *logger.Logger
}

func NewOpenPlatform

func NewOpenPlatform(config *UserConfig) (*OpenPlatform, error)

func (*OpenPlatform) GetAccessToken

func (app *OpenPlatform) GetAccessToken() *kernel.AccessToken

func (*OpenPlatform) GetComponent

func (app *OpenPlatform) GetComponent(name string) interface{}

func (*OpenPlatform) GetConfig

func (app *OpenPlatform) GetConfig() *kernel.Config

func (*OpenPlatform) GetContainer

func (app *OpenPlatform) GetContainer() *kernel.ServiceContainer

func (*OpenPlatform) GetFastRegistrationURL

func (app *OpenPlatform) GetFastRegistrationURL(ctx context.Context, callbackUrl string, optional *object.StringMap) (url string, err error)

Return the pre-authorization login page url. https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Before_Develop/Authorization_Process_Technical_Description.html

func (*OpenPlatform) GetMiniProgramAuthorizerConfig

func (app *OpenPlatform) GetMiniProgramAuthorizerConfig(appID string, refreshToken string) (userConfig *miniProgram2.UserConfig, err error)

func (*OpenPlatform) GetMobilePreAuthorizationURL

func (app *OpenPlatform) GetMobilePreAuthorizationURL(ctx context.Context, callbackUrl string, optional *object.StringMap) (url string, err error)

Return the pre-authorization login page url (mobile).

func (*OpenPlatform) GetOfficialAuthorizerConfig

func (app *OpenPlatform) GetOfficialAuthorizerConfig(appID string, refreshToken string) (userConfig *officialAccount2.UserConfig, err error)

func (*OpenPlatform) MiniProgram

func (app *OpenPlatform) MiniProgram(appID string, refreshToken string, accessToken *auth2.AccessToken) (application *miniProgram3.Application, err error)

func (*OpenPlatform) OfficialAccount

func (app *OpenPlatform) OfficialAccount(appID string, refreshToken string, accessToken *auth2.AccessToken) (application *officialAccount.Application, err error)

type UserConfig

type UserConfig struct {
	AppID           string
	Secret          string
	AuthCode        string
	Token           string
	AESKey          string
	StableTokenMode bool
	ForceRefresh    bool
	RefreshToken    string

	ResponseType string
	Log          Log
	OAuth        OAuth
	Cache        kernel.CacheInterface

	Http Http

	HttpDebug bool
	Debug     bool
	NotifyURL string
	Sandbox   bool
}

Jump to

Keyboard shortcuts

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