Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
CapturePath = "captures"
)
View Source
var Upgrader = websocket.Upgrader{ ReadBufferSize: 1024, CheckOrigin: func(r *http.Request) bool { return true }, }
Upgrader upgrades a web socket.
Functions ¶
func WriteCapture ¶
Types ¶
type CSVFormatter ¶
type CSVFormatter struct {
// contains filtered or unexported fields
}
CSVFormatter is a formatter that formats in comma separated format.
func (CSVFormatter) Format ¶
func (l CSVFormatter) Format(e Event) string
Format in comma separated file.
type ElasticsearchFormatter ¶
type ElasticsearchFormatter struct {
// contains filtered or unexported fields
}
ElasticsearchFormatter is a log formatter that can output to Elasticsearch.
func NewElasticsearchFormatter ¶
func NewElasticsearchFormatter(index, version, url string) (ElasticsearchFormatter, error)
NewElasticsearchFormatter creates a new formatter for Elasticsearch.
func (ElasticsearchFormatter) Format ¶
func (f ElasticsearchFormatter) Format(e Event) string
func (ElasticsearchFormatter) Write ¶
func (f ElasticsearchFormatter) Write(e Event) error
type Event ¶
type Event struct {
// The element which has been triggered.
Target string `json:"target",csv:"target"`
// The name attribute of the element.
Name string `json:"name",csv:"name"`
// The id attribute of the element.
ID string `json:"id",csv:"id"`
// The method which triggered the event.
Method string `json:"method",csv:"method"`
// The web page location on the server.
Location string `json:"location",csv:"location"`
// Any additional information that can be useful.
Comment string `json:"comment",csv:"comment"`
// X position of the event.
X int `json:"x",csv:"x"`
// Y position of the event.
Y int `json:"y",csv:"y"`
// Width of the actors screen.
ScreenWidth int `json:"screenWidth",csv:"screenWidth"`
// Height of the actors screen.
ScreenHeight int `json:"screenHeight",csv:"screenHeight"`
// The time the Event happened.
Time time.Time `json:"time",csv:"time"`
// The actor that caused the Event.
Actor string `json:"actor",csv:"actor"`
}
Event is something which has happened on a web page.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the way in which logs are written to a file.
func NewCSVLogger ¶
NewCSVLogger creates a new CSV logger.
func NewElasticsearchLogger ¶
NewElasticsearchLogger creates a new Elasticsearch logger.
func (Logger) GinEndpoint ¶
func (Logger) GorillaEndpoint ¶
func (l Logger) GorillaEndpoint(w http.ResponseWriter, r *http.Request)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
