Skip to content

Commit

Permalink
proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsk committed Feb 24, 2024
1 parent 3b32a63 commit ca53e76
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 9 deletions.
41 changes: 41 additions & 0 deletions cmd/group1/b_storageserv/a_app/b_storage_common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package app

import (
"errors"
"fmt"
"io/fs"
cmd "junodb_lite/pkg/d_cmd"
"os"
)

type (
CmdStorageCommon struct {
cmd.Command
optConfigFile string
optLogLevel string
}
)

func (c *CmdStorageCommon) Init(name string, desc string) {
//c.Command.Init(name, desc)
//c.StringOption(&c.optConfigFile, "c|config", "", "specify toml config file")
//c.StringOption(&c.optLogLevel, "log-level", kDefaultLogLevel, "specify log level")
}

func (c *CmdStorageCommon) Parse(args []string) (err error) {
if err = c.Command.Parse(args); err != nil {
return
}
if len(c.optConfigFile) == 0 {
fmt.Fprintf(os.Stderr, "\n\n*** missing config option ***\n\n")
c.FlagSet.Usage()
os.Exit(-1)
}

if _, err := os.Stat(c.optConfigFile); errors.Is(err, fs.ErrNotExist) {
fmt.Fprintf(os.Stderr, "\n\n*** config file \"%s\" not found ***\n\n", c.optConfigFile)
os.Exit(-1)
}

return
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
package app

import cmd "junodb_lite/pkg/d_cmd"

type (
CmdStorageCommon struct {
cmd.Command
optConfigFile string
optLogLevel string
}

Manager struct {
CmdStorageCommon
optNumChildren uint
Expand Down
2 changes: 1 addition & 1 deletion cmd/group1/b_storageserv/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "junodb_lite/cmd/group1/b_storageserv/app"
import app "junodb_lite/cmd/group1/b_storageserv/a_app"

func main() {
app.Main()
Expand Down

0 comments on commit ca53e76

Please sign in to comment.