views

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EventCollectionMap is a map indexing the attribute names of EventCollection
	// by view name.
	EventCollectionMap = map[string][]string{
		"default": {
			"id",
			"finding_id",
			"source_id",
			"score",
			"time",
		},
	}
	// EventMap is a map indexing the attribute names of Event by view name.
	EventMap = map[string][]string{
		"default": {
			"id",
			"finding_id",
			"source_id",
			"score",
			"time",
		},
	}
)

Functions

func ValidateEventCollection

func ValidateEventCollection(result EventCollection) (err error)

ValidateEventCollection runs the validations defined on the viewed result type EventCollection.

func ValidateEventCollectionView

func ValidateEventCollectionView(result EventCollectionView) (err error)

ValidateEventCollectionView runs the validations defined on EventCollectionView using the "default" view.

func ValidateEventView

func ValidateEventView(result *EventView) (err error)

ValidateEventView runs the validations defined on EventView using the "default" view.

Types

type EventCollection

type EventCollection struct {
	// Type to project
	Projected EventCollectionView
	// View to render
	View string
}

EventCollection is the viewed result type that is projected based on a view.

type EventCollectionView

type EventCollectionView []*EventView

EventCollectionView is a type that runs validations on a projected type.

type EventView

type EventView struct {
	// Finding event ID
	ID *string
	// Finding ID
	FindingID *string
	// Source ID
	SourceID *string
	// Finding severity score
	Score *float32
	// Event time
	Time *string
}

EventView is a type that runs validations on a projected type.

Jump to

Keyboard shortcuts

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