naverbandgo

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 7 Imported by: 0

README

naverbandgo GoDoc

go언어 네이버 밴드 API

Install

go get github.com/Beta5051/naverbandgo

Documentation

Index

Constants

View Source
const ENDPOINT = "https://openapi.band.us"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResult

type APIResult struct {
	ResultCode uint        `json:"result_code"`
	ResultData interface{} `json:"result_data"`
}

APIResult API 응답

func (*APIResult) To

func (result *APIResult) To(v interface{}) error

To API 응답 변환

type Album

type Album struct {
	PhotoAlbumKey string `json:"photo_album_key"`
	Name          string `json:"name"`
	PhotoCount    uint   `json:"photo_count"`
	CreateAt      uint   `json:"create_at"`
	Author        Author `json:"author"`
}

Album 앨범 정보

type Author

type Author struct {
	Name            string `json:"name"`
	Description     string `json:"description"`
	Role            string `json:"role"`
	ProfileImageUrl string `json:"profile_image_url"`
	UserKey         string `json:"user_key"`
}

Author 작성자 정보

type Band

type Band struct {
	Name        string `json:"name"`
	BandKey     string `json:"band_key"`
	Cover       string `json:"cover"`
	MemberCount uint   `json:"member_count"`
}

Band 밴드 정보 구조체

type CheckPermissionsResponse

type CheckPermissionsResponse struct {
	Permissions []string `json:"permissions"`
}

CheckPermissionsResponse 권한 조회 응답

type Client

type Client struct {
	AccessToken string
	HttpClient  *http.Client
}

Client 클라이언트

func NewClient

func NewClient(accessToken string, client *http.Client) *Client

NewClient 클라이언트 생성

func (*Client) CallAPI

func (client *Client) CallAPI(method string, path string, data map[string]interface{}) (*APIResult, error)

CallAPI API 요청

func (*Client) CheckPermissions

func (client *Client) CheckPermissions(bandKey string, permissions []string) ([]string, error)

CheckPermissions 권한 조회

func (*Client) CreateComment

func (client *Client) CreateComment(bandKey, postKey, body string) error

CreateComment 댓글 생성

func (*Client) CreatePost

func (client *Client) CreatePost(bandKey, content string, doPush bool) (returnBandKey, postKey string, err error)

CreatePost 글 생성

func (*Client) GetAlbums

func (client *Client) GetAlbums(bandKey string) ([]*Album, *NextParams, error)

GetAlbums 앨범 목록 조회

func (*Client) GetBands

func (client *Client) GetBands() (bands []*Band, err error)

GetBands 밴드 목록 조회

func (*Client) GetComments

func (client *Client) GetComments(bandKey, postKey string, nextParams *NextParams, creationOrder bool) ([]*Comment, *NextParams, error)

GetComments 댓글 목록 조회

func (*Client) GetPhotos

func (client *Client) GetPhotos(bandKey string, photoAlbumKey string) ([]*Photo, *NextParams, error)

GetPhotos 사진 목록 조회

func (*Client) GetPost

func (client *Client) GetPost(bandKey, postKey string) (*PostMoreInfo, error)

GetPost 글 상세 조회

func (*Client) GetPosts

func (client *Client) GetPosts(bandKey string, nextParams *NextParams, locale string) ([]*Post, *NextParams, error)

func (*Client) GetProfile

func (client *Client) GetProfile(bandKey string) (*Profile, error)

GetProfile 사용자 정보 조회

func (*Client) RemoveComment

func (client *Client) RemoveComment(bandKey, postKey, commentKey string) error

RemoveComment 댓글 삭제

func (*Client) RemovePost

func (client *Client) RemovePost(bandKey, postKey string) error

RemovePost 글 삭제

type Comment

type Comment struct {
	BandKey         string        `json:"band_key"`
	Author          *Author       `json:"author"`
	PostKey         string        `json:"post_key"`
	CommentKey      string        `json:"comment_key"`
	Content         string        `json:"content"`
	EmoticonCount   uint          `json:"emoticon_count"`
	IsAudioIncluded bool          `json:"is_audio_included"`
	CreateAt        uint          `json:"create_at"`
	Photo           *CommentPhoto `json:"photo"`
}

Comment 댓글 정보

type CommentPhoto

type CommentPhoto struct {
	Url    string `json:"url"`
	Height uint   `json:"height"`
	Width  uint   `json:"width"`
}

CommentPhoto 댓글 사진 정보

type CreatePostResponse

type CreatePostResponse struct {
	BandKey string `json:"band_key"`
	PostKey string `json:"post_key"`
}

CreatePostResponse 글 생성 응답

type GetAlbumsResponse

type GetAlbumsResponse struct {
	Paging struct {
		NextParams *NextParams `json:"next_params"`
	} `json:"paging"`
	Items []*Album
}

GetAlbumsResponse 앨범 목록 조회 응답

type GetBandsResponse

type GetBandsResponse struct {
	Bands []*Band `json:"bands"`
}

GetBandsResponse 밴드 목록 조회 응답

type GetCommentsResponse

type GetCommentsResponse struct {
	Paging struct {
		NextParams *NextParams `json:"next_params"`
	} `json:"paging"`
	Items []*Comment `json:"items"`
}

GetCommentsResponse 댓글 목록 조회 응답

type GetPhotosResponse

type GetPhotosResponse struct {
	Paging struct {
		NextParams *NextParams `json:"next_params"`
	} `json:"paging"`
	Items []*Photo `json:"items"`
}

GetPhotosResponse 사진 목록 조회 응답

type GetPostResponse

type GetPostResponse struct {
	Post *PostMoreInfo `json:"post"`
}

GetPostResponse 글 상제 조회 응답

type GetPostsResponse

type GetPostsResponse struct {
	Paging struct {
		NextParams *NextParams `json:"next_params"`
	} `json:"paging"`
	Items []*Post `json:"items"`
}

GetPostsResponse 글 목록 조회 응답

type LastComment

type LastComment struct {
	Body      string  `json:"body"`
	Author    *Author `json:"author"`
	CreatedAt uint    `json:"created_at"`
}

LastComment 최근 댓글 정보

type NextParams

type NextParams struct {
	After       string `json:"after"`
	Limit       string `json:"limit"`
	BandKey     string `json:"band_key"`
	AccessToken string `json:"access_token"`
}

NextParams 페이징 요청

func (*NextParams) Apply

func (params *NextParams) Apply(data map[string]interface{}) map[string]interface{}

Apply 페이징 요청 적용

type Photo

type Photo struct {
	Height           uint    `json:"height"`
	Width            uint    `json:"width"`
	CreatedAt        uint    `json:"created_at"`
	Url              string  `json:"url"`
	Author           *Author `json:"author"`
	PhotoAlbumKey    string  `json:"photo_album_key"`
	PhotoKey         string  `json:"photo_key"`
	CommentCount     uint    `json:"comment_count"`
	EmoticonCount    uint    `json:"emoticon_count"`
	IsVideoThumbnail bool    `json:"is_video_thumbnail"`
}

Photo 사진 정보

type Post

type Post struct {
	Content       string         `json:"content"`
	Author        *Author        `json:"author"`
	PostKey       string         `json:"post_key"`
	CommentCount  uint           `json:"comment_count"`
	CreatedAt     uint           `json:"created_at"`
	Photos        []*Photo       `json:"photos"`
	EmoticonCount uint           `json:"emoticon_count"`
	LastComments  []*LastComment `json:"last_comments"`
	BandKey       string         `json:"band_key"`
}

Post 글 정보

type PostMoreInfo

type PostMoreInfo struct {
	Content       string   `json:"content"`
	Author        *Author  `json:"author"`
	PostKey       string   `json:"post_key"`
	CommentCount  uint     `json:"comment_count"`
	CreatedAt     uint     `json:"created_at"`
	Photos        []*Photo `json:"photos"`
	EmoticonCount uint     `json:"emoticon_count"`
	BandKey       string   `json:"band_key"`
	PostReadCount uint     `json:"post_read_count"`
}

PostMoreInfo 글 상세 정보

type Profile

type Profile struct {
	UserKey         string `json:"user_key"`
	ProfileImageUrl string `json:"profile_image_url"`
	Name            string `json:"name"`
	IsAppMember     bool   `json:"is_app_member"`
	MessageAllowed  bool   `json:"message_allowed"`
}

Profile 사용자 정보

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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