Combine two subpackages and consolidate doc.go into filestystem.go for simplicity.

This commit is contained in:
Cody Soyland 2018-03-19 08:39:17 -05:00
parent 0a6f2d07f6
commit b36e8c7a14
5 changed files with 10 additions and 12 deletions

View file

@ -42,9 +42,6 @@ import (
"github.com/pilosa/pilosa/pql"
"unicode"
// Allow building Pilosa without the web UI.
_ "github.com/pilosa/pilosa/statik"
)
// Handler represents an HTTP handler.
@ -289,13 +286,13 @@ func (h *Handler) handleWebUI(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Welcome. Pilosa is running. Visit https://www.pilosa.com/docs/ for more information or try the WebUI by visiting this URL in your browser.", http.StatusNotFound)
return
}
statikFS, err := h.FileSystem.New()
filesystem, err := h.FileSystem.New()
if err != nil {
h.writeQueryResponse(w, r, &QueryResponse{Err: err})
h.logger().Println("Pilosa WebUI is not available. Please run `make generate-statik` before building Pilosa with `make install`.")
return
}
http.FileServer(statikFS).ServeHTTP(w, r)
http.FileServer(filesystem).ServeHTTP(w, r)
}
// handleGetSchema handles GET /schema requests.

View file

@ -31,7 +31,7 @@ import (
"github.com/pilosa/pilosa"
"github.com/pilosa/pilosa/internal"
"github.com/pilosa/pilosa/pql"
statik "github.com/pilosa/pilosa/statik/filesystem"
"github.com/pilosa/pilosa/statik"
"github.com/pilosa/pilosa/test"
)

View file

@ -35,7 +35,7 @@ import (
"github.com/pilosa/pilosa"
"github.com/pilosa/pilosa/gcnotify"
"github.com/pilosa/pilosa/gossip"
statik "github.com/pilosa/pilosa/statik/filesystem"
"github.com/pilosa/pilosa/statik"
"github.com/pilosa/pilosa/statsd"
)

View file

@ -1,4 +0,0 @@
// Package statik contains static assets for the Web UI. `go generate` will
// produce statik.go, which is ignored by git.
//go:generate statik -src=../webui -dest=..
package statik

View file

@ -11,8 +11,13 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//go:generate statik -src=../webui -dest=..
//
// Package statik contains static assets for the Web UI. `go generate` or
// `make generate-statik` will produce statik.go, which is ignored by git.
package filesystem
package statik
import (
"net/http"