Documentation ¶
Overview ¶
Package vkapps for VK Mini Apps.
See more https://vk.com/dev/vk_apps_docs
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParamsVerify ¶
ParamsVerify verifies the signature in link using client secret
Example ¶
package main import ( "fmt" "github.com/SevereCloud/vksdk/vkapps" ) func main() { link := "https://example.com/?vk_user_id=494075&vk_app_id=6736218&vk_is_app_user=1&vk_are_notifications_enabled=1&vk_language=ru&vk_access_token_settings=&vk_platform=android&sign=htQFduJpLxz7ribXRZpDFUH-XEUhC9rBPTJkjUFEkRA" v, _ := vkapps.ParamsVerify(link, "wvl68m4dR1UpLrVRli") fmt.Println(v) }
Output: true
Types ¶
type ParamsVerification ¶
type ParamsVerification struct {
ClientSecret string
}
ParamsVerification represents verification struct
Example ¶
package main import ( "fmt" "net/url" "github.com/SevereCloud/vksdk/vkapps" ) func main() { link := "https://example.com/?vk_user_id=494075&vk_app_id=6736218&vk_is_app_user=1&vk_are_notifications_enabled=1&vk_language=ru&vk_access_token_settings=&vk_platform=android&sign=htQFduJpLxz7ribXRZpDFUH-XEUhC9rBPTJkjUFEkRA" pv := vkapps.NewParamsVerification("wvl68m4dR1UpLrVRli") // Client secret u, _ := url.Parse(link) v, _ := pv.Verify(u) fmt.Println(v) }
Output: true
func NewParamsVerification ¶
func NewParamsVerification(clientSecret string) *ParamsVerification
NewParamsVerification return *ParamsVerification
func (*ParamsVerification) Sign ¶
func (pv *ParamsVerification) Sign(p []byte) string
Sign return signature in base64
func (*ParamsVerification) Verify ¶
func (pv *ParamsVerification) Verify(u *url.URL) (bool, error)
Verify verifies the signature in URL
func (*ParamsVerification) VerifyMiddleware ¶
func (pv *ParamsVerification) VerifyMiddleware(next http.Handler) http.Handler
VerifyMiddleware func
Click to show internal directories.
Click to hide internal directories.