mirror of https://github.com/ledisdb/ledisdb.git
Use more standard go; camel case
This commit is contained in:
parent
d48cb8c773
commit
7e4bc199fb
|
@ -64,7 +64,7 @@ type client struct {
|
|||
cmd string
|
||||
args [][]byte
|
||||
|
||||
is_authed bool
|
||||
isAuthed bool
|
||||
|
||||
resp responseWriter
|
||||
|
||||
|
@ -88,7 +88,7 @@ func newClient(app *App) *client {
|
|||
|
||||
c.app = app
|
||||
c.ldb = app.ldb
|
||||
c.is_authed = false || c.authEnabled()
|
||||
c.isAuthed = false || c.authEnabled()
|
||||
c.db, _ = app.ldb.Select(0) //use default db
|
||||
|
||||
return c
|
||||
|
@ -111,7 +111,7 @@ func (c *client) perform() {
|
|||
err = ErrEmptyCommand
|
||||
} else if exeCmd, ok := regCmds[c.cmd]; !ok {
|
||||
err = ErrNotFound
|
||||
} else if c.authEnabled() && !c.is_authed && c.cmd != "auth" {
|
||||
} else if c.authEnabled() && !c.isAuthed && c.cmd != "auth" {
|
||||
err = ErrNotAuthenticated
|
||||
} else {
|
||||
// if c.db.IsTransaction() {
|
||||
|
|
|
@ -20,11 +20,11 @@ func authCommand(c *client) error {
|
|||
}
|
||||
|
||||
if c.app.cfg.AuthPassword == string(c.args[0]) {
|
||||
c.is_authed = true
|
||||
c.isAuthed = true
|
||||
c.resp.writeStatus(OK)
|
||||
return nil
|
||||
} else {
|
||||
c.is_authed = false
|
||||
c.isAuthed = false
|
||||
return ErrAuthenticationFailure
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue