Implement list action (#12)

This commit is contained in:
Maxim Baz
2018-04-16 01:38:55 +02:00
committed by GitHub
parent 66850cfa4a
commit bd6ab67d3a
8 changed files with 120 additions and 18 deletions

View File

@@ -40,6 +40,18 @@ func MakeConfigureResponse() *ConfigureResponse {
}
}
// ListResponse a response format for the "list" request
type ListResponse struct {
Files map[string][]string `json:"files"`
}
// MakeListResponse initializes an empty list response
func MakeListResponse() *ListResponse {
return &ListResponse{
Files: make(map[string][]string),
}
}
// SendOk sends a success response to the browser extension in the predefined json format
func SendOk(data interface{}) {
send(&okResponse{