Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ for more information on how to use them.
- paste.query
- phid.lookup
- phid.query
- phriction.create
- phriction.info
- project.query
- remarkup.process
Expand Down
13 changes: 13 additions & 0 deletions phriction.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,16 @@ func (c *Conn) PhrictionInfo(

return &res, nil
}

// PhrictionCreate performs a call to phriction.create API endpoint.
func (c *Conn) PhrictionCreate(
req requests.PhrictionCreateRequest,
) (*responses.PhrictionCreateResponse, error) {
var res responses.PhrictionCreateResponse

if err := c.Call("phriction.create", &req, &res); err != nil {
return nil, err
}

return &res, nil
}
10 changes: 10 additions & 0 deletions requests/phriction.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package requests

// PhrictionInfoRequest represents a request to phriction.info API endpoint
type PhrictionInfoRequest struct {
Slug string `json:"slug"`
Request
}

// PhrictionCreateRequest represents a request to phriction.create API endpoint
type PhrictionCreateRequest struct {
Slug string `json:"slug"`
Title string `json:"title"`
Content string `json:"content"`
Decription string `json:"description,omitempty"`
Request
}
4 changes: 4 additions & 0 deletions responses/phriction.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ package responses

import "github.com/etcinit/gonduit/entities"

// PhrictionInfoResponse represents response from phriction.info endpoint.
type PhrictionInfoResponse entities.PhrictionDocument

// PhrictionCreateResponse represents response from phriction.create endpoint.
type PhrictionCreateResponse entities.PhrictionDocument