Skip to content

Commit

Permalink
tweak server cmd line
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Davis <[email protected]>
  • Loading branch information
duglin committed Jan 14, 2025
1 parent 803eabc commit e0ce739
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions cmds/server/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func LoadAPIGuru(reg *registry.Registry, orgName string, repoName string) *regis
// TODO Support "model" being part of the Registry struct above
}

log.VPrintf(1, "Loading registry: /reg-%s", reg.UID)
log.VPrintf(1, "Loading: /reg-%s", reg.UID)
g, err := reg.Model.AddGroupModel("apiproviders", "apiprovider")
ErrFatalf(err)
r, err := g.AddResourceModel("apis", "api", 2, true, true, true)
Expand Down Expand Up @@ -271,7 +271,7 @@ func LoadDirsSample(reg *registry.Registry) *registry.Registry {
ErrFatalf(reg.SetSave("arrmap[1].key1", "arrmapk1-value"))
}

log.VPrintf(1, "Loading registry: /reg-%s", reg.UID)
log.VPrintf(1, "Loading: /reg-%s", reg.UID)
gm, err := reg.Model.AddGroupModel("dirs", "dir")
ErrFatalf(err)
rm, err := gm.AddResourceModel("files", "file", 2, true, true, true)
Expand Down Expand Up @@ -331,7 +331,7 @@ func LoadEndpointsSample(reg *registry.Registry) *registry.Registry {
ErrFatalf(reg.SetSave("documentation", "https://github.com/duglin/xreg-github"))
}

log.VPrintf(1, "Loading registry: /reg-%s", reg.UID)
log.VPrintf(1, "Loading: /reg-%s", reg.UID)
fn, err := registry.FindModelFile("endpoint/model.json")
ErrFatalf(err)
err = reg.LoadModelFromFile(fn)
Expand Down Expand Up @@ -400,7 +400,7 @@ func LoadMessagesSample(reg *registry.Registry) *registry.Registry {
reg.SetSave("documentation", "https://github.com/duglin/xreg-github")
}

log.VPrintf(1, "Loading registry: /reg-%s", reg.UID)
log.VPrintf(1, "Loading: /reg-%s", reg.UID)
fn, err := registry.FindModelFile("message/model.json")
ErrFatalf(err)
err = reg.LoadModelFromFile(fn)
Expand Down Expand Up @@ -433,7 +433,7 @@ func LoadSchemasSample(reg *registry.Registry) *registry.Registry {
reg.SetSave("documentation", "https://github.com/duglin/xreg-github")
}

log.VPrintf(1, "Loading registry: /reg-%s", reg.UID)
log.VPrintf(1, "Loading: /reg-%s", reg.UID)
fn, err := registry.FindModelFile("schema/model.json")
ErrFatalf(err)
err = reg.LoadModelFromFile(fn)
Expand Down Expand Up @@ -467,7 +467,7 @@ func LoadLargeSample(reg *registry.Registry) *registry.Registry {
reg.SetSave("documentation", "https://github.com/duglin/xreg-github")
}

log.VPrintf(1, "Loading registry: /reg-%s", reg.UID)
log.VPrintf(1, "Loading: /reg-%s", reg.UID)
gm, _ := reg.Model.AddGroupModel("dirs", "dir")
gm.AddResourceModel("files", "file", 0, true, true, true)

Expand Down Expand Up @@ -523,7 +523,7 @@ func LoadDocStore(reg *registry.Registry) *registry.Registry {
reg.SetSave("documentation", "https://github.com/duglin/xreg-github")
}

log.VPrintf(1, "Loading registry: /reg-%s", reg.UID)
log.VPrintf(1, "Loading: /reg-%s", reg.UID)
gm, _ := reg.Model.AddGroupModel("documents", "document")
gm.AddResourceModel("formats", "format", 0, true, true, true)

Expand Down Expand Up @@ -576,7 +576,7 @@ func LoadCESample(reg *registry.Registry) *registry.Registry {
reg.SetSave("documentation", "https://github.com/duglin/xreg-github")
}

log.VPrintf(1, "Loading registry: /reg-%s", reg.UID)
log.VPrintf(1, "Loading: /reg-%s", reg.UID)
fn, err := registry.FindModelFile("cloudevents/model.json")
ErrFatalf(err)
err = reg.LoadModelFromFile(fn)
Expand Down
4 changes: 2 additions & 2 deletions cmds/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ func InitDB() {
go LoadLargeSample(nil)
}
}
log.Printf("Default registry: %s", reg.UID)
log.Printf("Default(/): reg-%s", reg.UID)

if reg == nil {
fmt.Fprintf(os.Stderr, "No registry loaded\n")
fmt.Fprintf(os.Stderr, "No default registry defined\n")
os.Exit(1)
}

Expand Down

0 comments on commit e0ce739

Please sign in to comment.