models

package
v0.0.0-...-004ddcb Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SampleFromMongoRecord

func SampleFromMongoRecord(mr MongoRecord) responses.SampleData

func ViewModelFromMongoRecord

func ViewModelFromMongoRecord(mr MongoRecord) responses.DataViewModel

Types

type MongoRecord

type MongoRecord struct {
	ObjectId     string    `bson:"_id,omitempty"`
	Description  string    `json:"description,omitempty"`
	Id           string    `json:"id,omitempty"`
	Seed         string    `json:"seed,omitempty"`
	Signature    string    `json:"signature,omitempty"`
	Timestamp    string    `json:"timestamp,omitempty"`
	TimestampISO time.Time `json:"timestampiso,omitempty"`
	Confidence   float64   `json:"confidence"`
}

func (MongoRecord) CopyForUpdate

func (mr MongoRecord) CopyForUpdate() MongoRecord

CopyForUpdate is necessary when updating a document in Mongo because the ObjectId on the incoming document must be blank. If not, there will be an error indicating a collision on the already populated, immutable value in the database.

Jump to

Keyboard shortcuts

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