esa

package
v0.0.0-...-b989405 Latest Latest
Warning

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

Go to latest
Published: May 28, 2017 License: MIT Imports: 11 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// CommentURL esa API のコメントのベ-スURL
	CommnetURL = "/v1/teams"
)
View Source
const (
	// MembersURL esa API のメンバーのベ-スURL
	MembersURL = "/v1/teams"
)
View Source
const (
	// PostURL esa API のコメントのベ-スURL
	PostURL = "/v1/teams"
)
View Source
const (
	// StatsURL esa API の統計情報のベ-スURL
	StatsURL = "/v1/teams"
)
View Source
const (
	// TeamURL esa API のチ-ムのベ-スURL
	TeamURL = "/v1/teams"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Client *http.Client

	Team    *TeamService
	Stats   *StatsService
	Post    *PostService
	Comment *CommentService
	Members *MembersService
	// contains filtered or unexported fields
}

Client esa API クライアント

func NewClient

func NewClient(apikey string) *Client

NewClient esa APIのClientを生成する

func Stub

func Stub(filename string, outRes interface{}) (*httptest.Server, *Client)

Stub テスト用のスタブ

type Comment

type Comment struct {
	BodyMd string `json:"body_md"`
	User   string `json:"user"`
}

Comment コメント

type CommentReq

type CommentReq struct {
	Comment Comment `json:"comment"`
}

CommentReq コメントのリクエスト

type CommentResponse

type CommentResponse struct {
	BodyHTML  string `json:"body_html"`
	BodyMd    string `json:"body_md"`
	CreatedAt string `json:"created_at"`
	CreatedBy struct {
		Icon       string `json:"icon"`
		Name       string `json:"name"`
		ScreenName string `json:"screen_name"`
	} `json:"created_by"`
	ID        int    `json:"id"`
	UpdatedAt string `json:"updated_at"`
	URL       string `json:"url"`
}

CommentResponse コメントのレスポンス

type CommentService

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

CommentService API docs: https://docs.esa.io/posts/102#7-0-0

func (*CommentService) Create

func (c *CommentService) Create(teamName string, postNumber int, comment Comment) (*CommentResponse, error)

PostTeamPostComment チ-ム名と記事番号とコメントを指定してコメントを投稿する

func (*CommentService) Delete

func (c *CommentService) Delete(teamName string, commentID int) error

DeleteTeamComment チ-ム名とコメントIDを指定してコメントを削除する

func (*CommentService) GetComment

func (c *CommentService) GetComment(teamName string, commentID int) (*CommentResponse, error)

GetTeamComment チ-ム名とコメントIDを取得してコメントを取得する.

func (*CommentService) GetComments

func (c *CommentService) GetComments(teamName string, postNumber int) (*CommentsResponse, error)

GetTeamPostComments チ-ム名と記事番号を指定してコメントを取得する.

func (*CommentService) Update

func (c *CommentService) Update(teamName string, commentID int, comment Comment) (*CommentResponse, error)

PatchTeamComment チ-ム名とコメントIDとコメントを指定してコメントを更新する

type CommentsResponse

type CommentsResponse struct {
	Comments   []CommentResponse `json:"comments"`
	NextPage   interface{}       `json:"next_page"`
	PrevPage   interface{}       `json:"prev_page"`
	TotalCount int               `json:"total_count"`
}

CommentsResponse 複数コメントのレスポンス

type Member

type Member struct {
	Email      string `json:"email"`
	Icon       string `json:"icon"`
	Name       string `json:"name"`
	ScreenName string `json:"screen_name"`
}

Member メンバー情報

type MembersResponse

type MembersResponse struct {
	Members    []Member    `json:"members"`
	NextPage   interface{} `json:"next_page"`
	PrevPage   interface{} `json:"prev_page"`
	TotalCount int         `json:"total_count"`
}

MembersResponse メンバー情報のレスポンス

type MembersService

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

MembersService API docs: https://docs.esa.io/posts/102#6-0-0

func (*MembersService) Get

func (s *MembersService) Get(teamName string) (*MembersResponse, error)

GetTeamMembers チ-ム名を指定してメンバー情報を取得する

type Post

type Post struct {
	BodyMd   string   `json:"body_md"`
	Category string   `json:"category"`
	Message  string   `json:"message"`
	Name     string   `json:"name"`
	Tags     []string `json:"tags"`
	Wip      bool     `json:"wip"`
}

Post 記事

type PostReq

type PostReq struct {
	Post Post `json:"post"`
}

PostReq 記事のリクエスト

type PostResponse

type PostResponse struct {
	BodyHTML      string `json:"body_html"`
	BodyMd        string `json:"body_md"`
	Category      string `json:"category"`
	CommentsCount int    `json:"comments_count"`
	CreatedAt     string `json:"created_at"`
	CreatedBy     struct {
		Icon       string `json:"icon"`
		Name       string `json:"name"`
		ScreenName string `json:"screen_name"`
	} `json:"created_by"`
	DoneTasksCount  int      `json:"done_tasks_count"`
	FullName        string   `json:"full_name"`
	Kind            string   `json:"kind"`
	Message         string   `json:"message"`
	Name            string   `json:"name"`
	Number          int      `json:"number"`
	OverLapped      bool     `json:"overlapped"`
	RevisionNumber  int      `json:"revision_number"`
	Star            bool     `json:"star"`
	StargazersCount int      `json:"stargazers_count"`
	Tags            []string `json:"tags"`
	TasksCount      int      `json:"tasks_count"`
	UpdatedAt       string   `json:"updated_at"`
	UpdatedBy       struct {
		Icon       string `json:"icon"`
		Name       string `json:"name"`
		ScreenName string `json:"screen_name"`
	} `json:"updated_by"`
	URL           string `json:"url"`
	Watch         bool   `json:"watch"`
	WatchersCount int    `json:"watchers_count"`
	Wip           bool   `json:"wip"`
}

PostResponse 記事のレスポンス

type PostService

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

PostService API docs: https://docs.esa.io/posts/102#6-0-0

func (*PostService) Create

func (p *PostService) Create(teamName string, post Post) (*PostResponse, error)

Create チ-ム名と記事を指定して記事を投稿する

func (*PostService) CreateSharing

func (p *PostService) CreateSharing(teamName string, postNumber int) (*SharedPost, error)

CreateSharing チ-ム名と記事を指定して記事を公開する

func (*PostService) Delete

func (p *PostService) Delete(teamName string, postNumber int) error

Delete チ-ム名と記事番号を指定して記事を削除する

func (*PostService) DeleteSharing

func (p *PostService) DeleteSharing(teamName string, postNumber int) error

DeleteSharing チ-ム名と記事番号を指定して公開リンクを削除する

func (*PostService) GetPost

func (p *PostService) GetPost(teamName string, postNumber int) (*PostResponse, error)

GetPost チ-ム名と記事番号を指定して記事を取得する

func (*PostService) GetPosts

func (p *PostService) GetPosts(teamName string, query url.Values) (*PostsResponse, error)

GetPosts チ-ム名とクエリを指定して記事を取得する

func (*PostService) Update

func (p *PostService) Update(teamName string, postNumber int, post Post) (*PostResponse, error)

Update チ-ム名と記事番号と記事を指定して記事を更新する

type PostsResponse

type PostsResponse struct {
	NextPage   interface{}    `json:"next_page"`
	Posts      []PostResponse `json:"posts"`
	PrevPage   interface{}    `json:"prev_page"`
	TotalCount int            `json:"total_count"`
}

PostsResponse 複数記事のレスポンス

type SharedPost

type SharedPost struct {
	HTML   string `json:"html"`
	Slides string `json:"slides"`
}

SharedPost 公開された記事

type StatsResponse

type StatsResponse struct {
	Comments           int `json:"comments"`
	DailyActiveUsers   int `json:"daily_active_users"`
	Members            int `json:"members"`
	MonthlyActiveUsers int `json:"monthly_active_users"`
	Posts              int `json:"posts"`
	Stars              int `json:"stars"`
	WeeklyActiveUsers  int `json:"weekly_active_users"`
}

StatsResponse 統計情報のレスポンス

type StatsService

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

StatsService API docs: https://docs.esa.io/posts/102#5-0-0

func (*StatsService) Get

func (s *StatsService) Get(teamName string) (*StatsResponse, error)

GetTeamStats チ-ム名を指定して統計情報を取得する

type TeamResponse

type TeamResponse struct {
	Description string `json:"description"`
	Icon        string `json:"icon"`
	Name        string `json:"name"`
	Privacy     string `json:"privacy"`
	URL         string `json:"url"`
}

TeamResponse チ-ムのレスポンス

type TeamService

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

TeamService API docs: https://docs.esa.io/posts/102#4-0-0

func (*TeamService) GetTeam

func (t *TeamService) GetTeam(teamName string) (*TeamResponse, error)

GetTeam チ-ム名を取得してチ-ムを取得する

func (*TeamService) GetTeams

func (t *TeamService) GetTeams() (*TeamsResponse, error)

GetTeams チ-ムを取得する

type TeamsResponse

type TeamsResponse struct {
	Teams      []TeamResponse `json:"teams"`
	PrevPage   interface{}    `json:"prev_page"`
	NextPage   interface{}    `json:"next_page"`
	TotalCount int            `json:"total_count"`
}

TeamsRespons 複数チ-ムのレスポンス

Jump to

Keyboard shortcuts

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