models

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2025 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkLog

type NetworkLog struct {
	ID       uint `json:"id" gorm:"primarykey"`
	ResultID uint `json:"result_id"`

	RequestType RequestType `json:"request_type"`
	StatusCode  int64       `json:"status_code"`
	URL         string      `json:"url"`
	RemoteIP    string      `json:"remote_ip"`
	MIMEType    string      `json:"mime_type"`
	Time        time.Time   `json:"time"`
	Content     []byte      `json:"content"`
	Error       string      `json:"error"`
}

type RequestType

type RequestType int

RequestType are network log types

const (
	HTTP RequestType = 0
	WS
)

type Result

type Result struct {
	ID uint `json:"id" gorm:"primarykey"`

	TestId       string    `json:"test_id"`
	User         string    `json:"username"`
	Password     string    `json:"password"`
	PasswordHash string    `json:"password_hash"`
	ProbedAt     time.Time `json:"probed_at"`

	UserExists      bool `json:"user_exists"`
	ValidCredential bool `json:"valid_credential"`

	Screenshot string `json:"screenshot"`
	HTML       string `json:"html" gorm:"index"`

	// Name of the screenshot file
	Filename string `json:"file_name"`

	// Failed flag set if the result should be considered failed
	Failed       bool   `json:"failed"`
	FailedReason string `json:"failed_reason"`

	Network []NetworkLog `json:"network" gorm:"constraint:OnDelete:CASCADE"`
}

Result is a github.com/helviojunior/spraysharksprayshark result

func (*Result) CalcHash added in v0.1.2

func (result *Result) CalcHash() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL