officialaccount

package
v0.0.0-...-15a7b9f Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 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 Config

type Config struct {
	AppID  string        // appid
	Secret string        // secret
	Cache  *gcache.Cache //cache
	Logger *log.Logger   //logger
}

type Credentials

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

func (*Credentials) Get

func (c *Credentials) Get() map[string]string

type DefaultJsapiTicket

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

func (*DefaultJsapiTicket) GetTicket

func (v *DefaultJsapiTicket) GetTicket() string

type JsapiTicket

type JsapiTicket interface {
	GetTicket() string
}

type Jssdk

type Jssdk struct {
	Debug     bool     `json:"debug"`
	AppID     string   `json:"appId"`
	Timestamp string   `json:"timestamp"`
	NonceStr  string   `json:"nonceStr"`
	Signature string   `json:"signature"`
	JsApiList []string `json:"jsApiList"`
}

func (*Jssdk) JsonString

func (j *Jssdk) JsonString() string

JsonString

func (*Jssdk) SetDebug

func (j *Jssdk) SetDebug(debug ...bool)

type OfficialAccount

type OfficialAccount struct {
	Logger *log.Logger
	Cache  *gcache.Cache
	// contains filtered or unexported fields
}

func New

func New(config Config) *OfficialAccount

func (*OfficialAccount) ConfigLoggerWithMap

func (oa *OfficialAccount) ConfigLoggerWithMap(m map[string]interface{})

logger -------------

func (*OfficialAccount) GetClient

func (oa *OfficialAccount) GetClient() *base.Client

func (*OfficialAccount) GetClientWithToken

func (oa *OfficialAccount) GetClientWithToken() *base.Client

func (*OfficialAccount) GetToken

func (oa *OfficialAccount) GetToken() string

GetToken

func (*OfficialAccount) JsapiTicket

func (oa *OfficialAccount) JsapiTicket() *DefaultJsapiTicket

func (*OfficialAccount) Jssdk

func (oa *OfficialAccount) Jssdk(url string, list []string) *Jssdk

func (*OfficialAccount) OAuth

func (oa *OfficialAccount) OAuth() *oauth2.WechatConfig

OAuth @see https://gitee.com/wallesoft/go/oauth2

func (*OfficialAccount) SetAccessToken

func (oa *OfficialAccount) SetAccessToken(token auth.AccessToken)

SetAccessToken 需要传入满足接口

func (*OfficialAccount) SetCache

func (oa *OfficialAccount) SetCache(c *gcache.Cache)

SetCache

Jump to

Keyboard shortcuts

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