Documentation
¶
Index ¶
Constants ¶
View Source
const ( TISTORY_OAUTH_AUTHENTICATIONTOKEN_GET_PATH = "https://www.tistory.com/oauth/authorize" TISTORY_OAUTH_ACCESSTOKEN_GET_PATH = "https://www.tistory.com/oauth/access_token" TISTORY_API_URL = "https://www.tistory.com/apis" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface {
// WritePost 글 작성하기
// @Param model.PostData
// return model.PostWriteResult, error
WritePost(data model.PostData) (model.PostWriteResult, error)
// WriteComment 댓글 작성하기
// @Param model.CommentData
// return model.CommentWriteResult, error
WriteComment(data model.CommentData) (model.CommentWriteResult, error)
// AttachFiles 파일 첨부하기
// @Param string // 블로그 명
// return model.AttachResult, error
AttachFiles(blogName string, filePath string) (model.AttachResult, error)
// GetBlogInfo 블로그 정보 가져오기
// return model.BlogResult, error
GetBlogInfo() (model.BlogResult, error)
// GetPostList 글 목록 가져오기
// @Param string int // 블로그 명, 글 목록 페이지 넘버
// return model.PostResult[model.PostListItem], error
GetPostList(blogName string, pageNumber int) (model.PostResult[model.PostListItem], error)
// GetPost 글 상세 데이터 가져오기
// @Param string // 블로그 명
// return model.PostResult[model.PostDetailItem], error
GetPost(blogName, postId string) (model.PostResult[model.PostDetailItem], error)
// GetNewestCommentList 최신 댓글 목록 가져오기
// @Param string, int, int // 블로그 명, 댓글 목록 페이지 넘버, 댓글 페이지당 댓글 수 (기본=10, 최대=10)
// return model.CommentResult[model.CommentNewestListItem], error
GetNewestCommentList(blogName string, pageNumber int, count int) (model.CommentResult[model.CommentNewestListItem], error)
// GetCommentList 댓글 목록 가져오기
// @Param model.CommentData
// return model.CommentResult[model.CommentListItem], error
GetCommentList(blogName, postId string) (model.CommentResult[model.CommentListItem], error)
// GetCategoryList 카테고리 목록 가져오기
// @Param string //블로그 명
// return model.CategoryResult, error
GetCategoryList(blogName string) (model.CategoryResult, error)
// UpdatePost 글 수정하기
// @Param model.PostUpdateData
// return model.PostWriteResult, error
UpdatePost(data model.PostUpdateData) (model.PostWriteResult, error)
// UpdateComment 댓글 수정하기
// @Param model.CommentUpdateData
// return model.CommentWriteResult, error
UpdateComment(data model.CommentUpdateData) (model.CommentWriteResult, error)
// DeleteComment 댓글 삭제하기
// @Param uint64, uint64
// return model.CommentDeleteResult, error
DeleteComment(blogName string, postId string, commentId string) (model.CommentDeleteResult, error)
// GetACToken 엑세스 토큰 확인
// return string
GetACToken() string
}
Service TistoryAPI 인터페이스 초기화 조건 : Selenium 설치후 authorization code를 받아야한다. 블로그 명 : 블로그 URL의 'xxx.tistory.com' xxx 부분을 의미 한다.
func NewService ¶
NewService Tistory API 생성함수 생성시 http 통신을 통해 Access Token을 받고 세팅한다. 이 생성 과정중 에러 발생 가능성이 가장 높으므로 잘 테스트 해보고 사용 할 것 @Params context.Context model.UserData // 컨텍스트, Tistory Open API 유저 데이터 return Service, error
Click to show internal directories.
Click to hide internal directories.