Skip to content

Commit

Permalink
Close #15 working web GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
dimus committed Oct 9, 2020
1 parent b9f0b86 commit c1212e9
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 3 deletions.
50 changes: 50 additions & 0 deletions bhlnames/cmd/web.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
*/
package cmd

import (
"github.com/gnames/bhlnames"
"github.com/gnames/bhlnames/config"
"github.com/gnames/bhlnames/data/librarian_pg"
"github.com/spf13/cobra"
"gitlab.com/gnames/bhlnames/web"
)

// webCmd represents the web command
var webCmd = &cobra.Command{
Use: "web",
Short: "Runs web server for GUI",
Run: func(cmd *cobra.Command, args []string) {
cnf := config.NewConfig()
l := librarian_pg.NewLibrarianPG(cnf)
bhln := bhlnames.NewBHLnames(cnf, l)
web.Run(bhln)
},
}

func init() {
rootCmd.AddCommand(webCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// webCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// webCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ require (
github.com/gnames/bhlindex v0.9.1-0.20200309183110-6f1d80629e2b
github.com/gnames/gnames v0.0.4-0.20201008102405-f7a355f710cf
github.com/gnames/uuid5 v0.1.1
github.com/gorilla/mux v1.7.0
github.com/gosuri/uiprogress v0.0.1
github.com/jinzhu/gorm v1.9.16
github.com/json-iterator/go v1.1.10
github.com/lib/pq v1.4.0
github.com/mitchellh/go-homedir v1.1.0
github.com/sirupsen/logrus v1.7.0 // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.7.0
gitlab.com/gogna/gnparser v0.14.1
golang.org/x/sys v0.0.0-20201005065044-765f4ea38db3 // indirect
google.golang.org/grpc v1.29.1
)
Loading

0 comments on commit c1212e9

Please sign in to comment.