Skip to content

Commit

Permalink
#9 Add part of knn classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
thegodenage committed May 15, 2024
1 parent fc691f8 commit a4cde35
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions internal/ddosml/knn.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,34 @@ import (
"fmt"
"io"
"math"
"sync"

"github.com/cdipaolo/goml/base"
)

type knnClassifier struct {
type KnnClassifier struct {
knn *knn

mu sync.Mutex
}

func NewKNNClassifier() *KnnClassifier {
return &KnnClassifier{
knn: &knn{},
}
}

func (k *knnClassifier) EnhanceClassifierWithRequest(m *Request) {
func (k *KnnClassifier) EnhanceClassifierWithRequest(m *Request) {
//TODO implement me
panic("implement me")
}

func (k *knnClassifier) IsRequestPotentialDDOS(ctx context.Context, m *Request) bool {
func (k *KnnClassifier) IsRequestPotentialDDOS(ctx context.Context, m *Request) bool {
//TODO implement me
panic("implement me")
}

func (k *knnClassifier) Write(writer io.Writer) error {
func (k *KnnClassifier) Write(writer io.Writer) error {
//TODO implement me
panic("implement me")
}
Expand Down

0 comments on commit a4cde35

Please sign in to comment.