Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] sessions/sessiondb/badger package not compatible with badger v1.6.0 #1367

Closed
bastengao opened this issue Sep 28, 2019 · 3 comments
Closed
Milestone

Comments

@bastengao
Copy link

Describe the bug

import (
	"github.com/kataras/iris"
	"github.com/kataras/iris/sessions"
	"github.com/kataras/iris/sessions/sessiondb/badger"
)

func init() {
	db, err := badger.New("tmp/badger_data")
	if err != nil {
		panic(err)
	}
	sess.UseDatabase(db)
}

go.mod like this

require (
	github.com/dgraph-io/badger v1.6.0 // indirect
	github.com/kataras/iris v11.1.1+incompatible
        // ...
)

run go run or go build will print these errors

# github.com/kataras/iris/sessions/sessiondb/badger
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:56:6: opts.Dir undefined (type func(string) badger.Options has no field or method Dir)
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:57:6: opts.ValueDir undefined (type func(string) badger.Options has no field or method ValueDir)
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:59:29: cannot use opts (type func(string) badger.Options) as type badger.Options in argument to badger.Open
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:81:18: too many arguments in call to txn.Commit
	have (nil)
	want ()
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:94:13: txn.SetWithTTL undefined (type *badger.Txn has no field or method SetWithTTL)
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:132:13: txn.SetWithTTL undefined (type *badger.Txn has no field or method SetWithTTL)
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:154:19: assignment mismatch: 2 variables but item.Value returns 1 values
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:154:32: not enough arguments in call to item.Value
	have ()
	want (func([]byte) error)
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:195:19: assignment mismatch: 2 variables but item.Value returns 1 values
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:195:32: not enough arguments in call to item.Value
	have ()
	want (func([]byte) error)
../../../../go/pkg/mod/github.com/kataras/[email protected]+incompatible/sessions/sessiondb/badger/database.go:195:19: too many errors

Expected behavior
Use badger as session db correctly.

Desktop (please complete the following information):

  • OS: macOS Mojave

Additional context
go version 1.13

I see badger 1.6.0 contains break changes https://github.com/dgraph-io/badger/releases/tag/v1.6.0, it is not compatible with sessions/sessiondb/badger package.

When I change badger version to v1.5.5 in go.mod file, it works.

require (
	github.com/dgraph-io/badger v1.5.5 // indirect
	github.com/kataras/iris v11.1.1+incompatible
        // ...
)
@kataras
Copy link
Owner

kataras commented Sep 28, 2019

@bastengao Iris is compatible with latest badger, don't worry. The problem here is that you are using an older version. Just go get github.com/kataras/[email protected] https://github.com/kataras/iris/wiki/Installation

@kataras kataras removed their assignment Sep 28, 2019
@bastengao
Copy link
Author

I tried it, but produced this issue #1355

@kataras
Copy link
Owner

kataras commented Oct 3, 2019

@bastengao Please vote at: #1370

@kataras kataras added this to the v12.0.0 milestone Oct 26, 2019
@kataras kataras closed this as completed Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants