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

Added redigo based IAttackStore implementation #66

Merged
merged 4 commits into from Jul 7, 2019

Conversation

nitishm
Copy link
Owner

@nitishm nitishm commented Jul 7, 2019

Added a redigo based redis store attack and report

models/db.go Outdated
}
if attackIDs, ok := res.([]interface{}); !ok {
return nil
} else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (from golint)

models/db.go Outdated

if err := json.Unmarshal(res.([]byte), &attack); err != nil {
return nil
} else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (from golint)

models/db.go Outdated
}

func (r Redis) GetAll(filterParams FilterParams) []AttackDetails {
var attacks []AttackDetails

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider preallocating attacks (from prealloc)

@nitishm nitishm merged commit 3b2862f into master Jul 7, 2019
@nitishm nitishm deleted the nitishm/enhancement/22/iattackstore branch July 7, 2019 02:01
@nitishm
Copy link
Owner Author

nitishm commented Jul 7, 2019

Fixes #22

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

Successfully merging this pull request may close these issues.

None yet

2 participants