Documentation
¶
Index ¶
- type Client
- type HTTPClient
- func (c HTTPClient) Create(title, message string, duration time.Duration) ([]byte, error)
- func (c HTTPClient) Delete(ids []string) error
- func (c HTTPClient) Edit(id string, title, message string, duration time.Duration) ([]byte, error)
- func (c HTTPClient) Fetch(ids []string) ([]byte, error)
- func (c HTTPClient) Healthy(host string) bool
- type Switch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Create(title, message string, duration time.Duration) ([]byte, error)
Edit(id string, title, message string, duration time.Duration) ([]byte, error)
Fetch(ids []string) ([]byte, error)
Delete(ids []string) error
Healthy(host string) bool
}
Client represents the client for communicating with backend API (here HTTP).
type HTTPClient ¶
type HTTPClient struct {
BackendURI string
// contains filtered or unexported fields
}
HTTPClient represents the HTTP client which communicates with reminders background API
func NewHTTPClient ¶
func NewHTTPClient(backendURI string) *HTTPClient
NewHTTPClient creates a new instance of HTTPClient
func (HTTPClient) Delete ¶
func (c HTTPClient) Delete(ids []string) error
Delete calls the fetch API endpoint
func (HTTPClient) Fetch ¶
func (c HTTPClient) Fetch(ids []string) ([]byte, error)
Fetch calls the fetch API endpoint
func (HTTPClient) Healthy ¶
func (c HTTPClient) Healthy(host string) bool
Healthy checks whether a given host is up and running
Click to show internal directories.
Click to hide internal directories.