mirror of
https://github.com/writeas/go-writeas.git
synced 2025-07-27 15:18:28 +00:00
Update developer.write.as -> developers.write.as
This commit is contained in:
parent
e6d5a2e79c
commit
b35223f930
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@ -4,4 +4,4 @@
|
||||
## Implementation
|
||||
|
||||
|
||||
[API documentation](https://developer.write.as/docs/api/?go#TODO-ENTER-SECTION-HERE).
|
||||
[API documentation](https://developers.write.as/docs/api/?go#TODO-ENTER-SECTION-HERE).
|
||||
|
@ -16,7 +16,7 @@ go get go.code.as/writeas.v2
|
||||
|
||||
## Documentation
|
||||
|
||||
See all functionality and usages in the [API documentation](https://developer.write.as/docs/api/).
|
||||
See all functionality and usages in the [API documentation](https://developers.write.as/docs/api/).
|
||||
|
||||
### Example usage
|
||||
|
||||
|
2
auth.go
2
auth.go
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// LogIn authenticates a user with Write.as.
|
||||
// See https://developer.write.as/docs/api/#authenticate-a-user
|
||||
// See https://developers.write.as/docs/api/#authenticate-a-user
|
||||
func (c *Client) LogIn(username, pass string) (*AuthUser, error) {
|
||||
u := &AuthUser{}
|
||||
up := struct {
|
||||
|
@ -34,7 +34,7 @@ type (
|
||||
|
||||
// CreateCollection creates a new collection, returning a user-friendly error
|
||||
// if one comes up. Requires a Write.as subscription. See
|
||||
// https://developer.write.as/docs/api/#create-a-collection
|
||||
// https://developers.write.as/docs/api/#create-a-collection
|
||||
func (c *Client) CreateCollection(sp *CollectionParams) (*Collection, error) {
|
||||
p := &Collection{}
|
||||
env, err := c.post("/collections", sp, p)
|
||||
@ -65,7 +65,7 @@ func (c *Client) CreateCollection(sp *CollectionParams) (*Collection, error) {
|
||||
|
||||
// GetCollection retrieves a collection, returning the Collection and any error
|
||||
// (in user-friendly form) that occurs. See
|
||||
// https://developer.write.as/docs/api/#retrieve-a-collection
|
||||
// https://developers.write.as/docs/api/#retrieve-a-collection
|
||||
func (c *Client) GetCollection(alias string) (*Collection, error) {
|
||||
coll := &Collection{}
|
||||
env, err := c.get(fmt.Sprintf("/collections/%s", alias), coll)
|
||||
@ -90,7 +90,7 @@ func (c *Client) GetCollection(alias string) (*Collection, error) {
|
||||
|
||||
// GetCollectionPosts retrieves a collection's posts, returning the Posts
|
||||
// and any error (in user-friendly form) that occurs. See
|
||||
// https://developer.write.as/docs/api/#retrieve-collection-posts
|
||||
// https://developers.write.as/docs/api/#retrieve-collection-posts
|
||||
func (c *Client) GetCollectionPosts(alias string) (*[]Post, error) {
|
||||
coll := &Collection{}
|
||||
env, err := c.get(fmt.Sprintf("/collections/%s/posts", alias), coll)
|
||||
|
10
post.go
10
post.go
@ -84,7 +84,7 @@ type (
|
||||
|
||||
// GetPost retrieves a published post, returning the Post and any error (in
|
||||
// user-friendly form) that occurs. See
|
||||
// https://developer.write.as/docs/api/#retrieve-a-post.
|
||||
// https://developers.write.as/docs/api/#retrieve-a-post.
|
||||
func (c *Client) GetPost(id string) (*Post, error) {
|
||||
p := &Post{}
|
||||
env, err := c.get(fmt.Sprintf("/posts/%s", id), p)
|
||||
@ -109,7 +109,7 @@ func (c *Client) GetPost(id string) (*Post, error) {
|
||||
}
|
||||
|
||||
// CreatePost publishes a new post, returning a user-friendly error if one comes
|
||||
// up. See https://developer.write.as/docs/api/#publish-a-post.
|
||||
// up. See https://developers.write.as/docs/api/#publish-a-post.
|
||||
func (c *Client) CreatePost(sp *PostParams) (*Post, error) {
|
||||
p := &Post{}
|
||||
endPre := ""
|
||||
@ -137,7 +137,7 @@ func (c *Client) CreatePost(sp *PostParams) (*Post, error) {
|
||||
}
|
||||
|
||||
// UpdatePost updates a published post with the given PostParams. See
|
||||
// https://developer.write.as/docs/api/#update-a-post.
|
||||
// https://developers.write.as/docs/api/#update-a-post.
|
||||
func (c *Client) UpdatePost(id, token string, sp *PostParams) (*Post, error) {
|
||||
return c.updatePost("", id, token, sp)
|
||||
}
|
||||
@ -176,7 +176,7 @@ func (c *Client) updatePost(collection, identifier, token string, sp *PostParams
|
||||
}
|
||||
|
||||
// DeletePost permanently deletes a published post. See
|
||||
// https://developer.write.as/docs/api/#delete-a-post.
|
||||
// https://developers.write.as/docs/api/#delete-a-post.
|
||||
func (c *Client) DeletePost(id, token string) error {
|
||||
return c.deletePost("", id, token)
|
||||
}
|
||||
@ -209,7 +209,7 @@ func (c *Client) deletePost(collection, identifier, token string) error {
|
||||
}
|
||||
|
||||
// ClaimPosts associates anonymous posts with a user / account.
|
||||
// https://developer.write.as/docs/api/#claim-posts.
|
||||
// https://developers.write.as/docs/api/#claim-posts.
|
||||
func (c *Client) ClaimPosts(sp *[]OwnedPostParams) (*[]ClaimPostResult, error) {
|
||||
p := &[]ClaimPostResult{}
|
||||
env, err := c.post("/posts/claim", sp, p)
|
||||
|
Loading…
Reference in New Issue
Block a user