Skip to content

Burmuley/go-vkapi

Repository files navigation

VK (Vkontakte) API SDK for Golang

Reviews appreciated! Just create an issue with your review/question/request in GO VKAPI Generator repository.

This repo contains Golang Software Development Kit (SDK) for the VK using public API of this social network.

All platform objects and methods were implemented according to the public JSON schema in official VK repository.

All code in this repository was generated by GO VKAPI Generator.

No manual changes accepted to this repository. All issues should be addressed to GO VKAPI Generator repository.

Repo structure

  • dir errors - package contains VK errors representation
  • dir objects - packages contains Go structures representing VK API objects, ready for marshaling/unmarshaling from/to JSON
  • dir responses - package contains Go structures representing VK API responses
  • api.go - contains implementation of the VK interface for basic functionality
  • api_utils.go - contains some useful utilities used in api.go
  • <method name>.go - file contains implementation of all methods related to appropriate API method name

Examples

Account operations

package main

import (
	"fmt"
	"github.com/Burmuley/go-vkapi"
)

package main

func main() {
    token := "<VK API token>"
  
    Api := go_vkapi.NewApiWithToken(token)
  	VKAccount := go_vkapi.Account{VKApi: Api}
  
  	if AccountInfo, err := VKAccount.Getprofileinfo(); err != nil {
  		fmt.Println(err)
  	} else {
  		fmt.Println(AccountInfo)
  	}	
}