vk

package
v0.0.0-...-30685e1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string

new; update; delete; restore

type AttachmentPhotoType

type AttachmentPhotoType struct {
	//https://vk.com/dev/objects/photo
	Id      int
	AlbumId int
	OwnerId int
	UserId  int
	Text    string
	Date    int
	Sizes   []struct {
		Type   string
		Url    string
		Width  int
		Height int
	}
	Width  int
	Height int
}

type AttachmentType

type AttachmentType struct {
	Type  string
	Photo AttachmentPhotoType
	Video AttachmentVideoType
}

type AttachmentVideoType

type AttachmentVideoType struct {
	//https://vk.com/dev/objects/video
	Id          int
	OwnerId     int
	Title       string
	Description string
	Duration    int // длительность видео в секундах

	Date       int
	AddingDate int
}

type Author

type Author struct {
	Id                  int
	AuthorUrl           string
	SharedPostAuthorId  int
	SharedPostAuthorUrl string
	Platform            int
}

type Client

type Client struct {
	Version string
	// contains filtered or unexported fields
}

func (*Client) AddRule

func (c *Client) AddRule(credentials StreamingAuth, rule Rule) (RuleResponse, error)

func (*Client) Authorize

func (c *Client) Authorize() (string, error)

func (*Client) GetRules

func (c *Client) GetRules(credentials StreamingAuth) ([]Rule, error)

func (*Client) GetServerUrl

func (c *Client) GetServerUrl() (StreamingAuth, error)

func (*Client) Initialize

func (c *Client) Initialize(accessToken string) error

func (*Client) RemoveRule

func (c *Client) RemoveRule(credentials StreamingAuth, tag string) (RuleResponse, error)

func (*Client) Stream

func (c *Client) Stream(credentials StreamingAuth, streamsCount int, messageChan chan []byte)

type CoordinateType

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

type ErrorMessage

type ErrorMessage struct {
	Message   string
	ErrorCode int
}

type EventId

type EventId struct {
	PostOwnerId  int
	PostId       int
	CommentId    int
	SharedPostId int
	TopicOwnerId int
	TopicId      int
	TopicPostId  int
}

type EventType

type EventType string

post; comment; share; topic_post

type GeoType

type GeoType struct {
	Type        string
	Coordinates CoordinateType
	Place       interface{}
}

type Rule

type Rule struct {
	Tag   string `json:"tag"`
	Value string `json:"value,omitempty"`
}

type RuleResponse

type RuleResponse struct {
	Code  int
	Error ErrorMessage
}

type RulesResponse

type RulesResponse struct {
	Code  int
	Rules []Rule
	Error ErrorMessage
}

type ServiceMessage

type ServiceMessage struct {
	Message     string
	ServiceCode int
}

type StreamEvent

type StreamEvent struct {
	EventType EventType
	EventId   EventId
	EventUrl  string
	Text      string

	Action       ActionType
	ActionTime   int
	CreationTime int
	Attachments  []interface{}

	Geo                    GeoType
	SharedPostText         string
	SharedPostCreationTime int
	SignerId               int
	Tags                   []string

	Author Author
}

type StreamResponse

type StreamResponse struct {
	Code           int
	Event          StreamEvent
	ServiceMessage ServiceMessage
}

type StreamingAuth

type StreamingAuth struct {
	Endpoint string
	Key      string
}

Jump to

Keyboard shortcuts

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