<commit_before>package hoverfly

import (
	"bytes"
	"crypto/md5"
	"encoding/gob"
	"fmt"
	"io"
	"net/http"

	log "github.com/Sirupsen/logrus"
	"io/ioutil"
)

// DBClient provides access to cache, http client and configuration
type DBClient struct {
	Cache   Cache
	HTTP    *http.Client
	Cfg     *Configuration
	Counter *CounterByMode
}

// RequestContainer holds structure for request
type RequestContainer struct {
	Details RequestDetails
}

var emptyResp = &http.Response{}

// RequestDetails stores information about request, it's used for creating unique hash and also as a payload structure
type RequestDetails struct {
	Path        string              `json:"path"`
	Method      string              `json:"method"`
	Destination string              `json:"destination"`
	Scheme      string              `json:"scheme"`
	Query       string              `json:"query"`
	Body        string              `json:"body"`
	RemoteAddr  string              `json:"remoteAddr"`
	Headers     map[string][]string `json:"headers"`
}

func (r *RequestContainer) concatenate() string {
	var buffer bytes.Buffer

	buffer.WriteString(r.Details.Destination)
	buffer.WriteString(r.Details.Path)
	buffer.WriteString(r.Details.Method)
	buffer.WriteString(r.Details.Query)
	buffer.WriteString(r.Details.Body)
<commit_msg>hooks added to db client<commit_after>package hoverfly

import (
	"bytes"
	"crypto/md5"
	"encoding/gob"
	"fmt"
	"io"
	"net/http"

	log "github.com/Sirupsen/logrus"
	"io/ioutil"
)

// DBClient provides access to cache, http client and configuration
type DBClient struct {
	Cache   Cache
	HTTP    *http.Client
	Cfg     *Configuration
	Counter *CounterByMode
	Hooks   ActionTypeHooks
}

// RequestContainer holds structure for request
type RequestContainer struct {
	Details RequestDetails
}

var emptyResp = &http.Response{}

// RequestDetails stores information about request, it's used for creating unique hash and also as a payload structure
type RequestDetails struct {
	Path        string              `json:"path"`
	Method      string              `json:"method"`
	Destination string              `json:"destination"`
	Scheme      string              `json:"scheme"`
	Query       string              `json:"query"`
	Body        string              `json:"body"`
	RemoteAddr  string              `json:"remoteAddr"`
	Headers     map[string][]string `json:"headers"`
}

func (r *RequestContainer) concatenate() string {
	var buffer bytes.Buffer

	buffer.WriteString(r.Details.Destination)
	buffer.WriteString(r.Details.Path)
	buffer.WriteString(r.Details.Method)
	buffer.WriteString(r.Details.Query)
	buffer.WriteString(r.Details.Body)

{'fraction_non_alphanumeric': 0.09696969696969697, 'fraction_numerical': 0.0007575757575757576, 'mean_word_length': 3.1137071651090342, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5337837', 'n_tokens_mistral': 766, 'n_tokens_neox': 760, 'n_words': 210}