canny

package
v0.0.0-...-bca240c Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	APIKey  string
	BaseURL string
}

Client provides methods to interact with canny.io api

func (*Client) CreateComment

func (s *Client) CreateComment(comment CreateComment) (string, error)

CreateComment create a new comment in Canny and returns its id or error

func (*Client) CreatePost

func (s *Client) CreatePost(post CreatePost) (string, error)

CreatePost create a new post in Canny and returns its id or error

func (*Client) CreateVote

func (s *Client) CreateVote(vote CreateVote) error

CreateVote create a new vote in Canny and returns its id or error

func (*Client) FindOrCreateUser

func (s *Client) FindOrCreateUser(user FindOrCreateUser) (string, error)

FindOrCreateUser finds or creates a user

type CreateComment

type CreateComment struct {
	AuthorID  string   `json:"authorID"`
	PostID    string   `json:"postID"`
	Value     string   `json:"value"`
	ImageURLs []string `json:"imageURLs,omitempty"`
	ParentID  string   `json:"parentID,omitempty"`
}

CreateComment contains fields/params for a comments/create api call

type CreatePost

type CreatePost struct {
	AuthorID  string   `json:"authorID"`
	BoardID   string   `json:"boardID"`
	Details   string   `json:"details"`
	Title     string   `json:"title"`
	ImageURLs []string `json:"imageURLs,omitempty"`
}

CreatePost contains fields/params for a posts/create api call

type CreateVote

type CreateVote struct {
	PostID  string `json:"postID"`
	VoterID string `json:"voterID"`
}

CreateVote contains fields/params for a votes/create api call

type FindOrCreateUser

type FindOrCreateUser struct {
	AvatarURL string    `json:"avatarURL,omitempty"`
	Created   time.Time `json:"created,omitempty"`
	Email     string    `json:"email,omitempty"`
	Name      string    `json:"name,omitempty"`
	UserID    string    `json:"userID,omitempty"`
}

FindOrCreateUser contains fields/params for find_or_create api call

Jump to

Keyboard shortcuts

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