The library covers our usage, but might not be comprehensive of the API. So we always welcome contributions and improvements from the community. Before sending pull requests, make sure you've done the following:
-* Run `go fmt` on all updated .go files.
+* Run `goimports` on all updated .go files.
* Document all exported structs and funcs.
## License
MIT
diff --git a/auth_test.go b/auth_test.go
index 3c78c7e..a9ece6f 100644
--- a/auth_test.go
+++ b/auth_test.go
@@ -1,21 +1,19 @@
package writeas
-import (
- "testing"
-)
+import "testing"
func TestAuthentication(t *testing.T) {
dwac := NewDevClient()
// Log in
_, err := dwac.LogIn("demo", "demo")
if err != nil {
t.Fatalf("Unable to log in: %v", err)
}
// Log out
err = dwac.LogOut()
if err != nil {
t.Fatalf("Unable to log out: %v", err)
}
}
diff --git a/collection.go b/collection.go
index d63e116..9b4a925 100644
--- a/collection.go
+++ b/collection.go
@@ -1,137 +1,186 @@
package writeas
import (
"fmt"
"net/http"
)
type (
// Collection represents a collection of posts. Blogs are a type of collection
// on Write.as.
Collection struct {
Alias string `json:"alias"`
Title string `json:"title"`
Description string `json:"description"`
StyleSheet string `json:"style_sheet"`
Private bool `json:"private"`
Views int64 `json:"views"`
Domain string `json:"domain,omitempty"`
Email string `json:"email,omitempty"`
URL string `json:"url,omitempty"`
TotalPosts int `json:"total_posts"`
Posts *[]Post `json:"posts,omitempty"`
}
// CollectionParams holds values for creating a collection.