Documentation ¶
Index ¶
- Variables
- func HandleResponse[T any](res *http.Response) (T, error)
- func ParseJsonBody(res io.ReadCloser, out interface{}) (err error)
- func ToPointer[T any](in T, err error) (*T, error)
- type Category
- type CategoryClient
- func (c *CategoryClient) All() ([]api.Category, error)
- func (c *CategoryClient) Create(category *Category) (*api.Category, error)
- func (c *CategoryClient) Get(id string) (*api.Category, error)
- func (c CategoryClient) GetJson(endpoint string) (*http.Response, error)
- func (c CategoryClient) PostJson(endpoint string, payload interface{}) (*http.Response, error)
- func (c CategoryClient) PutJson(endpoint string, payload interface{}) (*http.Response, error)
- type HTTPClient
- type NewRecord
- type RecordClient
- func (c *RecordClient) Create(create *NewRecord) (*api.Record, error)
- func (c *RecordClient) Get(id string) (*api.Record, error)
- func (c RecordClient) GetJson(endpoint string) (*http.Response, error)
- func (c RecordClient) PostJson(endpoint string, payload interface{}) (*http.Response, error)
- func (c RecordClient) PutJson(endpoint string, payload interface{}) (*http.Response, error)
- func (c *RecordClient) Update(record *api.Record) (*api.Record, error)
- func (c *RecordClient) UpdatePages(recordId string, updatedPages []api.PageUpdate) (*api.Record, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ParseJsonBody ¶
func ParseJsonBody(res io.ReadCloser, out interface{}) (err error)
Types ¶
type CategoryClient ¶
type CategoryClient struct {
// contains filtered or unexported fields
}
func (*CategoryClient) Create ¶
func (c *CategoryClient) Create(category *Category) (*api.Category, error)
type HTTPClient ¶
type HTTPClient struct { Records *RecordClient Categories *CategoryClient // contains filtered or unexported fields }
func NewHTTPClient ¶
func NewHTTPClient(uri string, timeout time.Duration) (*HTTPClient, error)
type RecordClient ¶
type RecordClient struct {
// contains filtered or unexported fields
}
func (*RecordClient) UpdatePages ¶
func (c *RecordClient) UpdatePages(recordId string, updatedPages []api.PageUpdate) (*api.Record, error)
Click to show internal directories.
Click to hide internal directories.