not public; lint

This commit is contained in:
Michael Quigley 2022-07-29 15:28:40 -04:00
parent 4b3c22d02a
commit cb1a88e339
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
3 changed files with 6 additions and 6 deletions

View File

@ -27,12 +27,12 @@ func createAccountHandler(params identity.CreateAccountParams) middleware.Respon
Password: hashPassword(params.Body.Password),
Token: token,
}
tx, err := Str.Begin()
tx, err := str.Begin()
if err != nil {
logrus.Errorf("error starting transaction: %v", err)
return identity.NewCreateAccountInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
}
id, err := Str.CreateAccount(a, tx)
id, err := str.CreateAccount(a, tx)
if err != nil {
logrus.Errorf("error creating account: %v", err)
_ = tx.Rollback()

View File

@ -12,7 +12,7 @@ import (
"github.com/pkg/errors"
)
var Str *store.Store
var str *store.Store
func Run(cfg *Config) error {
swaggerSpec, err := loads.Embedded(rest_server_zrok.SwaggerJSON, rest_server_zrok.FlatSwaggerJSON)
@ -29,7 +29,7 @@ func Run(cfg *Config) error {
api.TunnelUntunnelHandler = tunnel.UntunnelHandlerFunc(untunnelHandler)
if v, err := store.Open(cfg.Store); err == nil {
Str = v
str = v
} else {
return errors.Wrap(err, "error opening store")
}

View File

@ -14,11 +14,11 @@ import (
func ZrokAuthenticate(token string) (*rest_model_zrok.Principal, error) {
logrus.Infof("authenticating")
tx, err := Str.Begin()
tx, err := str.Begin()
if err != nil {
return nil, err
}
if a, err := Str.FindAccountWithToken(token, tx); err == nil {
if a, err := str.FindAccountWithToken(token, tx); err == nil {
principal := rest_model_zrok.Principal{
ID: int64(a.Id),
Token: a.Token,