Documentation
¶
Overview ¶
Package callback implements Callback API.
See more https://vk.com/dev/callback_api
Package callback implements Callback API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNeedGroupToken = errors.New("callback: need group access token")
ErrNeedGroupToken for AutoSetting.
Functions ¶
func RetryAfter ¶
RetryAfter send the "Retry-After" header field to indicate how long the VK Callback ought to wait before making a repeated request. Not work with goroutine mode!
Possible HTTP status codes:
http.StatusGone http.StatusTooManyRequests http.StatusServiceUnavailable
The resend time range must be less than 3 hours. The actual time of forwarding an event notification may be longer than the specified time.
func RetryCounterFromContext ¶
RetryCounterFromContext returns the X-Retry-Counter from context.
Types ¶
type Callback ¶
type Callback struct {
ConfirmationKeys map[int]string
ConfirmationKey string
SecretKeys map[int]string
SecretKey string
Title string
// ErrorLog specifies an optional logger for errors unexpected
// behavior from handlers.
// If nil, logging is done via the log package's standard logger.
ErrorLog *log.Logger
events.FuncList
}
Callback struct SecretKeys [GroupID]SecretKey.
func (*Callback) AutoSetting ¶
AutoSetting automatically configures callback.
Need *api.VK with group access token, access setting: community management.
func (*Callback) HandleFunc ¶
func (cb *Callback) HandleFunc(w http.ResponseWriter, r *http.Request)
HandleFunc handler.