vk

package
v0.0.0-...-4532fda Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const API_VERSION string = `5.33`
View Source
const DEFAULT_PHOTO_COUNT int = 500
View Source
const URL_API string = `https://api.vk.com/method/`
View Source
const URL_LOGIN string = `https://login.vk.com/`
View Source
const VERSION string = "5.33"

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	Id          int
	OwnerId     int `json:"owner_id"`
	Title       string
	Description string
	Size        int
}

type Client

type Client struct {
	*http.Client
}

func (*Client) CookieMap

func (this *Client) CookieMap(u *url.URL) map[string]string

func (*Client) GetJson

func (this *Client) GetJson(url string, result interface{}) error

type Count

type Count struct {
	Count int
}

type Photo

type Photo struct {
	Id      int
	OwnerId int `json:"owner_id"`
	AlbumId int `json:"album_id"`
	Date    Timestamp

	Likes    Count
	Comments Count
}

func (Photo) HasLikes

func (photo Photo) HasLikes() bool

func (Photo) LikesCount

func (photo Photo) LikesCount() int

type Timestamp

type Timestamp time.Time

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(b []byte) error

type VkApi

type VkApi struct {
	Login string
	// contains filtered or unexported fields
}

func NewApi

func NewApi(login string, password string, scope string) *VkApi

func (*VkApi) Auth

func (api *VkApi) Auth() error

func (*VkApi) GetPhotos

func (api *VkApi) GetPhotos(album Album) ([]Photo, error)

func (*VkApi) PhotosGetAlbums

func (api *VkApi) PhotosGetAlbums(owner int) ([]Album, error)

type VkApiError

type VkApiError struct {
	Code    int    `json:"error_code"`
	Message string `json:"error_msg"`
}

func (VkApiError) Error

func (e VkApiError) Error() string

type VkAuthError

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

func (VkAuthError) Error

func (e VkAuthError) Error() string

type VkError

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

func (VkError) Error

func (e VkError) Error() string

func (VkError) String

func (e VkError) String() string

Jump to

Keyboard shortcuts

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