Documentation
¶
Index ¶
- type SBClient
- func (client *SBClient) Append(page string, data string, separator string) (body string, err error)
- func (client *SBClient) CreateRequest(method string, page string, body io.Reader) (req *http.Request, err error)
- func (client *SBClient) Delete(page string) (body string, err error)
- func (client *SBClient) Get(page string) (body string, err error)
- func (client *SBClient) Put(page string, data string) (body string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SBClient ¶
SBClient holds the necessary data to send http requests to the silverbullet API
func (*SBClient) Append ¶
Append uses GET and PUT methods. First gets the current contents of the file After that, appends the new data after the separator. current + separator + new data Takes page, data and separator strings Returns the response body and error
func (*SBClient) CreateRequest ¶
func (client *SBClient) CreateRequest(method string, page string, body io.Reader) (req *http.Request, err error)
CreateRequest creates a http.Request with the given parameters and sets the necessary headers for the silverbullet API Takes url, token, method strings and a body io.Reader returns *http.Request, error
func (*SBClient) Delete ¶
Delete removes the given page Takes a page parameter Returns the response body and error
Click to show internal directories.
Click to hide internal directories.