Closed tbarbugli closed 3 years ago
Yes, this package is still alive. As your IDE is showing you, you should not be importing the internal
folder.
This might be a helpful stack overflow response: https://stackoverflow.com/questions/59342373/use-of-internal-package-not-allowed
The README shows an example of importing the aws-dax-go package to your project.
If there is a different issue here and I misunderstood, please reopen the ticket.
It looks like the version of aws-sdk-go that you are using is behind the version required by aws-dax-go. The types that are undefined were added in version 1.35.34 of aws-sdk-go. Try go get github.com/aws/aws-sdk-go
.
For an example of how to use the client, see the code in github.com/aws-samples/aws-dax-go-sample. The comment above about not importing the internal packages of aws-dax-go is correct.
@ktseytlin the screenshot is from the vendor/github.com/aws/aws-dax-go/dax/api.go
file not from my project
@kevinchristen I will try to upgrade to latest of aws-sdk-go, I am using Go modules btw. The deps you have on the repo are also out of date:
[[constraint]]
name = "github.com/aws/aws-sdk-go"
version = "1.30.7"
FTR I did not mean to sound provocative but I see so many issues with this lib that I was wondering if it was still alive and well, happy to help out with feedback if it gets answered :)
We are happy for the feedback; don't worry about sounding provocative. Can you clarify if you have been able to get past the problems reported above by updating aws-sdk-go and not trying to import the internal packages of aws-dax-go? If not, what problems are you seeing now? Please share your code if you can (not just a screenshot). Thanks.
I found out the issue, our project is using go modules and has aws-sdk to ~1.33. I am not 100% sure but I this might be related to the fact that this lib does not have a go.mod
manifest.
Probably a good idea to make this into a go module (when you do be careful because the dep dependency file will be used by go mod init
and that manifest is using 1.30.7
:))
One thing I noticed is that DAX and DynamoDB have slightly different methods to construct their clients (New
/ NewWithSession
, Session
vs *Session
)
func GetDynamo() *dynamodb.DynamoDB {
config := &aws.Config{}
sess := session.Must(session.NewSession(config))
svc := dynamodb.New(sess)
return svc
}
func GetDAX() (*dax.Dax, error) {
config := &aws.Config{}
sess := session.Must(session.NewSession(config))
client, err := dax.NewWithSession(*sess)
return client, err
}
We added support for go modules to this and the aws-dax-go-sample repository. Thanks for the advice; I hope that eliminates the problems with mismatched versions.
I dont see much activity plus my first attempt on a Go project using modules fails on import errors
Is this the best way to use DAX with Golang?