viewmodels

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobResponse

type JobResponse struct {
	ID        string             `json:"id"`
	Type      string             `json:"type"`
	ScanID    uint               `json:"scan_id"`
	URL       string             `json:"url"`
	Status    entities.JobStatus `json:"status"`
	CreatedAt time.Time          `json:"created_at"`
}

JobResponse represents the structure for outgoing job data in the API response

func ConvertJob

func ConvertJob(job entities.JobModel) JobResponse

ConvertJob converts an entity job to a viewmodel job response

type Scan

type Scan struct {
	ID uint `json:"id"`

	Url        string `json:"url"`
	Title      string `json:"title"`
	StatusCode int    `json:"status_code"`

	Status string `json:"status"`

	Sha256 string `json:"sha256"`
	SHA1   string `json:"sha1"`
	MD5    string `json:"md5"`

	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

func ConvertScan

func ConvertScan(scan entities.ScanModel) Scan

func ConvertScans

func ConvertScans(scans []entities.ScanModel) []Scan

type ScanRequest

type ScanRequest struct {
	URL       string `json:"url"`
	UserAgent string `json:"user_agent,omitempty"`
}

ScanRequest represents the structure of the incoming scan request

Jump to

Keyboard shortcuts

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