mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-07 19:30:22 -05:00
server: RootTracker interface is now once again part of ChunkStore
This commit is contained in:
@@ -14,9 +14,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
port *string = flag.String("port", "8000", "")
|
||||
cs chunks.ChunkStore
|
||||
tracker chunks.RootTracker
|
||||
port *string = flag.String("port", "8000", "")
|
||||
cs chunks.ChunkStore
|
||||
)
|
||||
|
||||
func handler(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -25,7 +24,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path[1:] {
|
||||
case "root":
|
||||
w.Header().Add("content-type", "text/plain")
|
||||
fmt.Fprintf(w, "%v", tracker.Root().String())
|
||||
fmt.Fprintf(w, "%v", cs.Root().String())
|
||||
case "get":
|
||||
hashString := r.URL.Query()["ref"][0]
|
||||
ref, err := ref.Parse(hashString)
|
||||
@@ -64,7 +63,7 @@ func createDummyData() {
|
||||
|
||||
Chk.NotNil(cs)
|
||||
enc.WriteValue(a, cs)
|
||||
tracker.UpdateRoot(a.Ref(), tracker.Root())
|
||||
cs.UpdateRoot(a.Ref(), cs.Root())
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -77,9 +76,6 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: Shouldn't have to cast here.
|
||||
tracker = cs.(chunks.RootTracker)
|
||||
|
||||
createDummyData()
|
||||
|
||||
http.HandleFunc("/", handler)
|
||||
|
||||
Reference in New Issue
Block a user