open_platform

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenPlatform

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

OpenPlatform 微信开放平台

func New

func New(appId, appSecret, token, aesKey string, opts ...Option) *OpenPlatform

New 微信开放平台sdk实例

func (*OpenPlatform) AccessToken

func (open *OpenPlatform) AccessToken() (contracts.AccessToken, error)

AccessToken 获取开放平台access_token

func (*OpenPlatform) AccessTokenCacheKey

func (open *OpenPlatform) AccessTokenCacheKey() string

AccessTokenCacheKey 获取开放平台access_token缓存key

func (*OpenPlatform) AesKey

func (open *OpenPlatform) AesKey() string

func (*OpenPlatform) AppId

func (open *OpenPlatform) AppId() string

func (*OpenPlatform) AppSecret

func (open *OpenPlatform) AppSecret() string

func (*OpenPlatform) Authorizer

func (open *OpenPlatform) Authorizer() *authorizer.Authorizer

Authorizer 公众账号授权

func (*OpenPlatform) AuthorizerAccessToken

func (open *OpenPlatform) AuthorizerAccessToken(appId, authorizerRefreshToken string, refresh bool, locker lock.Locker) (contracts.AccessToken, error)

AuthorizerAccessToken 代公众账号获取access_token

func (*OpenPlatform) AuthorizerAccessTokenCacheKey

func (open *OpenPlatform) AuthorizerAccessTokenCacheKey(appId string) string

AuthorizerAccessTokenCacheKey 公众账号access_token缓存key

func (*OpenPlatform) AuthorizerAccountAesKey

func (open *OpenPlatform) AuthorizerAccountAesKey() string

func (*OpenPlatform) AuthorizerAccountToken

func (open *OpenPlatform) AuthorizerAccountToken() string

func (*OpenPlatform) Cache

func (open *OpenPlatform) Cache() (cache.Cache, string)

func (*OpenPlatform) Code

func (open *OpenPlatform) Code() *code.Code

Code 小程序代码管理

func (*OpenPlatform) CodeTemplate

func (open *OpenPlatform) CodeTemplate() *code_template.CodeTemplate

CodeTemplate 小程序代码模板

func (*OpenPlatform) ComponentAccessToken

func (open *OpenPlatform) ComponentAccessToken() string

func (*OpenPlatform) ComponentAppId

func (open *OpenPlatform) ComponentAppId() string

func (*OpenPlatform) IsOpenPlatform

func (open *OpenPlatform) IsOpenPlatform() bool

func (*OpenPlatform) MiniProgram

func (open *OpenPlatform) MiniProgram(appId, authorizerRefreshToken string) *mini_program.MiniProgram

MiniProgram 授权到开放平台的小程序 @param appId string 小程序appID @param authorizerRefreshToken string 小程序授权刷新token

func (*OpenPlatform) Official

func (open *OpenPlatform) Official(appId, authorizerRefreshToken string) *official.Official

Official 授权到开放平台的公众号 @param appId string 公众号appID @param authorizerRefreshToken string 公众号授权刷新token

func (*OpenPlatform) Server

func (open *OpenPlatform) Server() *server.Server

Server 服务端

func (*OpenPlatform) Token

func (open *OpenPlatform) Token() string

type Option

type Option func(*option)

func WithCache

func WithCache(cache cache.Cache) Option

WithCache 设置缓存

func WithCacheKeyPrefix

func WithCacheKeyPrefix(cacheKeyPrefix string) Option

WithCacheKeyPrefix 设置缓存key前缀

func WithLocker

func WithLocker(locker lock.Locker) Option

WithLocker 设置锁

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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