feat: init

This commit is contained in:
Rogee
2024-11-27 11:55:09 +08:00
parent e0eb7e5e2e
commit e4b9cc5f26
13 changed files with 462 additions and 2 deletions

39
pkg/wechat/options.go Normal file
View File

@@ -0,0 +1,39 @@
package wechat
import "github.com/imroc/req/v3"
type Options func(*Client)
func WithAppID(appID string) Options {
return func(we *Client) {
we.appID = appID
}
}
// WithAppSecret sets the app secret
func WithAppSecret(appSecret string) Options {
return func(we *Client) {
we.appSecret = appSecret
}
}
// WithToken sets the token
func WithToken(token string) Options {
return func(we *Client) {
we.token = token
}
}
// WithAESKey sets the AES key
func WithAESKey(aesKey string) Options {
return func(we *Client) {
we.aesKey = aesKey
}
}
// WithClient sets the http client
func WithClient(client *req.Client) Options {
return func(we *Client) {
we.client = client
}
}