Documentation
¶
Index ¶
- type Page
- type Pages
- type RawPage
- 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) GetPages(skip bool, skipStrings ...string) (pages *Pages, 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 Pages ¶ added in v1.0.1
type Pages struct {
PageSlice *[]Page
}
func (Pages) GetLatestCreated ¶ added in v1.0.1
func (Pages) GetLatestModified ¶ added in v1.0.1
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
func (*SBClient) Get ¶
Get sends a get request to the silverbullet API using the custom client Takes a page parameter Returns the content of the page and error