models

package
v0.0.0-...-57cc518 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEvent

func DeleteEvent(db *sqlx.DB, eventID *uuid.UUID) error

DeleteEvent deletes an event

func JSONType

func JSONType(b []byte) string

JSONType is a helper to infer the JSON type from []byte; object or array https://stackoverflow.com/questions/55014001/check-if-json-is-object-or-array

func RunConsequencesByBoundingBox

func RunConsequencesByBoundingBox(cbb compute.BboxCompute) (consequences.ConsequenceDamageResult, error)

RunConsequencesByBoundingBox Runs the Consequences by bounding box

Types

type Audit

type Audit struct {
	Creator    int       `json:"creator"`
	CreateDate time.Time `json:"create_date" db:"create_date"`
}

Audit captures information on create and modify

type Compute

type Compute struct {
	ID         uuid.UUID `json:"id"`
	EventID    uuid.UUID `json:"event_id" db:"event_id"`
	EventDepth float64   `json:"event_depth" db:"event_depth"`
	FIPS       string    `json:"fips"`
	Audit
}

func GetCompute

func GetCompute(db *sqlx.DB, id *uuid.UUID) (*Compute, error)

func RunCompute

func RunCompute(db *sqlx.DB, ae asyncer.Asyncer, c *Compute) (*Compute, error)

type Event

type Event struct {
	ID    uuid.UUID `json:"id"`
	Name  string    `json:"name"`
	Depth float64   `json:"depth"`
	Audit
}

Event is an event

func CreateEvent

func CreateEvent(db *sqlx.DB, event *Event) (*Event, error)

CreateEvent creates a new event

func ListEvents

func ListEvents(db *sqlx.DB) ([]Event, error)

ListEvents lists all events

Jump to

Keyboard shortcuts

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