openPlatform

package
v2.0.2-beta04 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapUserConfig

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

Types

type Log

type Log struct {
	Level string
	File  string
	ENV   string
}

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(callbackUrl string, optional *object.StringMap) string

Return the pre-authorization login page url.

func (*OpenPlatform) GetMiniProgramAuthorizerConfig

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

func (*OpenPlatform) GetMobilePreAuthorizationURL

func (app *OpenPlatform) GetMobilePreAuthorizationURL(callbackUrl string, optional *object.StringMap) string

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

func (*OpenPlatform) GetOfficialAuthorizerConfig

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

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

	ResponseType string
	Log          Log
	OAuth        OAuth
	Cache        kernel.CacheInterface

	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