Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { Model Name string `json:"name" db:"NAME"` Timestamp time.Time `json:"timestamp" db:"TIMESTAMP"` Camera string `json:"camera" db:"CAMERA"` Severity string `json:"severity" db:"SEVERITY"` Message string `json:"message" db:"MESSAGE"` AcknowledgedAt NullTime `json:"acknowledged_at,omitempty" db:"ACKNOWLEDGED_AT"` ResolvedAt NullTime `json:"resolved_at,omitempty" db:"RESOLVED_AT"` }
func (*Alert) PrepareCreate ¶
PrepareCreate prepares an Alert object for persistence Returns list of fields to save
type Camera ¶
type Camera struct { Model Name string `json:"name" db:"NAME"` Latitude float64 `json:"latitude" db:"LATITUDE"` Longitude float64 `json:"longitude" db:"LONGITUDE"` LocalPath NullString `json:"local_path,omitempty" db:"LOCAL_PATH"` }
func (*Camera) PrepareCreate ¶
PrepareCreate prepares a Video object for persistence Returns list of fields to save
type Descriptor ¶
Descriptor describes a table
func AlertDescriptor ¶
func AlertDescriptor() Descriptor
VideoDescriptor describes the Video table (returns name and filterset)
func CameraDescriptor ¶
func CameraDescriptor() Descriptor
CameraDescriptor describes the Video table (returns name and filterset)
func PictureDescriptor ¶
func PictureDescriptor() Descriptor
PictureDescriptor describes the Picture table (returns name and filterset)
func UserDescriptor ¶
func UserDescriptor() Descriptor
UserDescriptor describes the User table (returns name and filterset)
func VideoDescriptor ¶
func VideoDescriptor() Descriptor
VideoDescriptor describes the Video table (returns name and filterset)
type JsonList ¶
type JsonList struct { sql.NullString Populated bool }
Particular type of string that contains a json array of tags
func (JsonList) MarshalJSON ¶
Scan the field as a json array
func (*JsonList) UnmarshalJSON ¶
Value turns the array into a database string
type Media ¶
type Media struct { Model Timestamp time.Time `json:"timestamp" db:"TIMESTAMP"` Camera string `json:"camera" db:"CAMERA"` Tags JsonList `json:"tags,omitempty" db:"TAGS"` MediaURL NullString `json:"media_url,omitempty" db:"MEDIA_URL"` }
func (*Media) PrepareCreate ¶
PrepareCreate prepares a Media object for persistence Returns list of fields to save
type Model ¶
type Model struct { ID string `json:"id" db:"ID"` CreatedAt time.Time `json:"created_at" db:"CREATED_AT"` ModifiedAt time.Time `json:"modified_at" db:"MODIFIED_AT"` }
Model is the base for all models. Oracle always caps lock...
func (*Model) PrepareCreate ¶
Prepare a model to be created into the database Return list of columns to be written
type NullString ¶
type NullString struct { sql.NullString Populated bool }
func (NullString) MarshalJSON ¶
func (n NullString) MarshalJSON() ([]byte, error)
Scan the field as a json array
func (*NullString) UnmarshalJSON ¶
func (n *NullString) UnmarshalJSON(data []byte) error
Value turns the array into a database string
type NullTime ¶
func (NullTime) MarshalJSON ¶
Scan the field as a json array
func (*NullTime) UnmarshalJSON ¶
Value turns the array into a database string