Documentation ¶
Index ¶
- Constants
- func NewClient(baseURL string) *restClient
- func NewClientContext(baseURL string, ctx context.Context, timeout time.Duration) *restClient
- func NewCustomClientContext(client *http.Client, baseURL string, ctx context.Context, ...) *restClient
- func NewServer(backed storages.Storage) http.Handler
Constants ¶
View Source
const (
DefaultTimeout = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func NewClientContext ¶
func NewCustomClientContext ¶
func NewServer ¶
Creates new http handler and provides REST-like access to storage.
GET / - array of all keys. Each key - base64 encoded. New line - new key. Stream is chunk encoded. Returns 200
GET /:key - content of key. Returns 404 if key not found. key should be base64 encoded
POST,PUT,PATCH /:key - update or insert value for key. Returns 204 on success. key should be base64 encoded
DELETE /:key - remove key. Returns 204 on success. key should be base64 encoded
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.