models

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

View Source
const (
	MailStatusUnread  = 101 // Job has not run
	MailStatusRead    = 201 // Job has not run
	MailStatusDeleted = 301 // Job has not run

)

Status codes for jobs

View Source
const (

	//ModalitySensed imples that the datapoint was sensed
	ModalitySensed string = "sensed"

	//ModalitySelfReported imples that the datapint was manually inputed
	ModalitySelfReported string = "self-reported"
)
View Source
const (
	RoleAdmin  string = "admin"
	RoleCoach  string = "coach"
	RolePlayer string = "player"
	RoleMedic  string = "medic"
	RoleOwner  string = "owner"
	RoleMember string = "member"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquisitionProvenance

type AcquisitionProvenance struct {
	SourceName             string `json:"source_name" bson:"source_name"`
	SourceCreationDateTime string `json:"source_creation_date_time" bson:"source_creation_date_time"`
	Modality               string `json:"modality" bson:"modality"`
}

AcquisitionProvenance describes how datapoint was acquired.

type Cronbox

type Cronbox struct {
	JobID         int       `json:"jobId" db:"job_id"`
	OwnerID       string    `json:"ownerId" db:"owner_id"`
	Schedule      string    `json:"schedule" db:"schedule"`
	Timezone      string    `json:"timezone" db:"timezone"`
	Created       time.Time `json:"created" db:"created"`
	LastRun       time.Time `json:"lastRun" db:"last_run"`
	Expire        time.Time `json:"expire" db:"expire"`
	StatusMessage string    `json:"statusMessage" db:"status_message"`
	StatusCode    int       `json:"statusCode" db:"status_code"`
	Count         int       `json:"count" db:"count"`
	CountMax      int       `json:"countMax" db:"count_max"`
	MessageID     string    `json:"messageId" db:"message_id"`
}

Cronbox lists scheduled mail delivery

type DataPoint

type DataPoint struct {
	Header Header      `json:"header" bson:"header"`
	Body   interface{} `json:"body" bson:"body"`
}

DataPoint is the unit of storage in OMH compatible DSUs

type Header struct {
	ID                    string                `json:"id" bson:"id,omitempty"`
	CreationDateTime      time.Time             `json:"creation_date_time" bson:"creation_date_time"`
	SchemaID              SchemaID              `json:"schema_id" bson:"schema_id"`
	AcquisitionProvenance AcquisitionProvenance `json:"acquisition_provenance" bson:"acquisition_provenance"`
	UserID                string                `json:"user_id" bson:"user_id"`
	AdditionalProperties  interface{}           `json:"additional_properties" bson:"additional_properties"`
}

Header includes datapoint metadata for the body

type Mailbox

type Mailbox struct {
	OwnerID       string    `json:"ownerId" db:"owner_id"`
	Name          string    `json:"name" db:"name"`
	MessageID     string    `json:"messageId" db:"message_id"`
	StatusCode    int       `json:"status_code" db:"status_code"`
	StatusMessage string    `json:"status_message" db:"status_message"`
	Date          time.Time `json:"date" db:"date"`
}

Mailbox lists status on mail delivery

type Message

type Message struct {
	MessageID  string    `json:"messageId" db:"message_id"`
	From       string    `json:"from" db:"from"`
	Sender     string    `json:"sender" db:"sender"`
	ReplyTo    string    `json:"replyTo" db:"reply_to"`
	InReplyTo  string    `json:"inReplyTo" db:"in_reply_to"`
	To         string    `json:"to" db:"to"`
	Cc         string    `json:"cc" db:"cc"`
	Bcc        string    `json:"bcc" db:"bcc"`
	References string    `json:"references" db:"references"`
	Date       time.Time `json:"date" db:"date"`
	Subject    string    `json:"subject" db:"subject"`
	Body       string    `json:"body" db:"body"`
}

Message sturcture with RFC-4021 compatible fields.

type Profile

type Profile struct {
	ID         string `json:"sub" db:"id, primarykey"`
	GivenName  string `json:"given_name" db:"given_name"`
	FamilyName string `json:"family_name" db:"family_name"`
	NickName   string `json:"nickname" db:"nickname"`
	Name       string `json:"name" db:"name"`
	UpdatedAt  string `json:"updated_at" db:"updated_at"`
	Picture    string `json:"picture" db:"picture"`
	Email      string `json:"email" db:"email"`
}

Profile holds personal user information

type PushSubscription

type PushSubscription struct {
	Sub       string    `json:"sub" db:"sub"`
	Platform  string    `json:"platform" db:"platform"`
	Token     string    `json:"token" db:"token"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
}

PushSubscription holds tokens for device push messaging

type Response

type Response struct {
	Message string `json:"message"`
}

Response encode Server reply

type Role

type Role struct {
	ID     int    `json:"-" db:"id, primarykey, autoincrement"`
	PID    string `json:"pId" db:"pid"`
	TeamID string `json:"team_id" db:"team_id"`
	Role   string `json:"role" db:"role"`
}

Role maps user identities to team roles

type SchemaID

type SchemaID struct {
	NameSpace string      `json:"namespace" bson:"namespace"`
	Name      string      `json:"name" bson:"name"`
	Version   interface{} `json:"version" bson:"version"`
}

SchemaID describe the body-type of a datapoint

type Team

type Team struct {
	ID          string `json:"id" db:"id, primarykey, autoincrement"`
	Name        string `json:"name" db:"name"`
	Email       string `json:"email" db:"email"`
	Description string `json:"description" db:"description"`
	LogoURL     string `json:"logo_url" db:"logo_url"`
}

Team holds team information

type UserToken

type UserToken struct {
	//	ID           int       `json:"-" db:"id, primarykey, autoincrement"`
	Sub          string    `json:"sub" db:"sub"`
	Aud          string    `json:"aud" db:"aud"`
	AccessToken  string    `json:"access_token" db:"access_token"`
	TokenType    string    `json:"token_type,omitempty" db:"token_type"`
	RefreshToken string    `json:"refresh_token,omitempty" db:"refresh_token"`
	Expiry       time.Time `json:"expiry,omitempty" db:"expiry"`
}

UserToken holds users' access token. Extends the oauth2.Token structure with additional information

type UserTokenQuery

type UserTokenQuery struct {
	Sub string `json:"sub" db:"sub"`
	Aud string `json:"aud" db:"aud"`
}

UserTokenQuery are used to query the database for tokens

type Version

type Version struct {
	Major int `json:"major" bson:"major"`
	Minor int `json:"minor" bson:"minor"`
}

Version a schema verion

Jump to

Keyboard shortcuts

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