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

func FindFinding

func FindFinding(findings []entities.FindingModel, finding entities.FindingModel) bool

Types

type Content

type Content struct {
	ID           uint      `json:"id"`
	FileSize     int64     `json:"file_size"`
	FileType     string    `json:"file_type"`
	StorageType  string    `json:"storage_type"`
	LastAccessed time.Time `json:"last_accessed"`
	AccessCount  int64     `json:"access_count"`
	Body         string    `json:"body"`
}

type Contents

type Contents struct {
	ID           uint      `json:"id"`
	FileSize     int64     `json:"file_size"`
	FileType     string    `json:"file_type"`
	StorageType  string    `json:"storage_type"`
	LastAccessed time.Time `json:"last_accessed"`
	AccessCount  int64     `json:"access_count"`
	Tags         []string  `json:"tags"`
	ObjectKey    string    `json:"object_key"`
}

Contents represents the data returned in API responses.

func ConvertContent

func ConvertContent(content entities.ContentModel, tags []string, storage entities.ContentStorageModel) Contents

ConvertContent converts a ContentModel to ContentResponse.

func ConvertContents

func ConvertContents(contents []entities.ContentModel, tagsMap map[uint][]string, storageMap map[uint]entities.ContentStorageModel) []Contents

ConvertContents converts a list of ContentModel to ContentResponse.

func ConvertSingleContent

func ConvertSingleContent(content entities.ContentModel) Contents

type Finding

type Finding struct {
	ID     uint `json:"id"`
	ScanID uint `json:"scan_id"`

	RegexName        string `json:"regex_name"`
	RegexDescription string `json:"regex_description"`

	Match  string `json:"match"`
	Source string `json:"source"`
	Line   int    `json:"line"`

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

func ConvertFindings

func ConvertFindings(findings []entities.FindingModel) []Finding

Jump to

Keyboard shortcuts

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