models

package
v0.0.0-...-1af33b5 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

DB is a connection to your database to be used throughout your application.

Q is a map of SQL queries

Functions

This section is empty.

Types

type Comment

type Comment struct {
	ID        uuid.UUID  `json:"id" db:"id"`
	CreatedAt time.Time  `json:"created_at" db:"created_at"`
	UserEmail string     `json:"user_email" db:"user_email"`
	UserID    uuid.UUID  `json:"user_id" db:"user_id"`
	Message   string     `json:"message" db:"message"`
	Org       slices.Map `json:"org" db:"org"`
}

Comment is a struct for the model

func (Comment) String

func (c Comment) String() string

String is not required by pop and may be deleted

func (*Comment) Validate

func (c *Comment) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Comment) ValidateCreate

func (c *Comment) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Comment) ValidateUpdate

func (c *Comment) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Comments

type Comments []Comment

Comments is not required by pop and may be deleted

func (Comments) String

func (c Comments) String() string

String is not required by pop and may be deleted

type File

type File struct {
	ID        uuid.UUID `json:"id" db:"id"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UserID    uuid.UUID `json:"user_id" db:"user_id"`
	Name      string    `json:"name" db:"name"`
	File      []byte    `json:"file" db:"file"`
}

File is the survey data file

func (File) String

func (f File) String() string

String is not required by pop and may be deleted

func (File) TableName

func (File) TableName() string

TableName overrides the schema and table name

func (*File) Validate

func (f *File) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*File) ValidateCreate

func (f *File) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*File) ValidateUpdate

func (f *File) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type FileInfo

type FileInfo struct {
	ID        uuid.UUID `json:"id" db:"id"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UserID    uuid.UUID `json:"user_id" db:"user_id"`
	Name      string    `json:"name" db:"name"`
}

FileInfo is the survey data file info

func (FileInfo) String

func (f FileInfo) String() string

String is not required by pop and may be deleted

func (FileInfo) TableName

func (FileInfo) TableName() string

TableName overrides the schema and table name

type Files

type Files []FileInfo

Files is not required by pop and may be deleted

func (Files) String

func (f Files) String() string

String is not required by pop and may be deleted

type IpsativeData

type IpsativeData struct {
	QuestionID          uuid.UUID `json:"question_id" db:"question_id"`
	QuestionTitle       string    `json:"question_title" db:"question_title"`
	QuestionOrderNumber int       `json:"question_order_number" db:"question_order_number"`
	AnswerID            uuid.UUID `json:"answer_id" db:"answer_id"`
	Answer              string    `json:"answer" db:"answer"`
	Category            string    `json:"category" db:"category"`
	AnswerOrderNumber   int       `json:"answer_order_number" db:"answer_order_number"`
}

IpsativeData is for the gets all ipsative data

func (IpsativeData) TableName

func (IpsativeData) TableName() string

TableName overrides the schema and table name

type IpsativeSurvey

type IpsativeSurvey Survey

IpsativeSurvey Is for the ipsative surveys available

func (IpsativeSurvey) TableName

func (IpsativeSurvey) TableName() string

TableName overrides the schema and table name

type LikertQuestion

type LikertQuestion Question

LikertQuestion is for the likert survey questions.

func (LikertQuestion) TableName

func (LikertQuestion) TableName() string

TableName overrides the schema and table name

type LikertSurvey

type LikertSurvey Survey

LikertSurvey Is for the ipsative surveys available

func (LikertSurvey) TableName

func (LikertSurvey) TableName() string

TableName overrides the schema and table name

type PostComment

type PostComment struct {
	Message string `json:"message" db:"message"`
}

PostComment is a struct for the model to get from a post

type Question

type Question struct {
	ID            uuid.UUID `json:"id" db:"id"`
	CreatedAt     time.Time `json:"created_at" db:"created_at"`
	SurveyID      uuid.UUID `json:"survey_id" db:"survey_id"`
	ChoiceGroupID uuid.UUID `json:"choice_group_id" db:"choice_group_id"`
	OrderNumber   int       `json:"order_number" db:"order_number"`
	Title         string    `json:"title" db:"title"`
}

Question is the question info for the survey

type State

type State struct {
	ID   uuid.UUID  `json:"id" db:"id"`
	JSON slices.Map `json:"json" db:"json"`
}

State provides us with the current state of the user

func (State) String

func (c State) String() string

String is not required by pop and may be deleted

func (*State) Validate

func (c *State) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*State) ValidateCreate

func (c *State) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*State) ValidateUpdate

func (c *State) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type StateBinding

type StateBinding struct {
	Status           *string `json:"status"`
	DownloadedReport *bool   `json:"downloaded_report"`
}

StateBinding provides us with something to bind to

type States

type States []State

States is not required by pop and may be deleted

func (States) String

func (c States) String() string

String is not required by pop and may be deleted

type Survey

type Survey struct {
	ID           uuid.UUID `json:"id" db:"id"`
	CreatedAt    time.Time `json:"created_at" db:"created_at"`
	Author       string    `json:"author" db:"author"`
	Name         string    `json:"name" db:"name"`
	Description  string    `json:"description" db:"description"`
	Instructions string    `json:"instructions" db:"instructions"`
}

Survey is the survey data

func (Survey) String

func (s Survey) String() string

String is not required by pop and may be deleted

func (*Survey) Validate

func (s *Survey) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Survey) ValidateCreate

func (s *Survey) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Survey) ValidateUpdate

func (s *Survey) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type SurveyResponse

type SurveyResponse struct {
	ID          uuid.UUID  `json:"id" db:"id"`
	CreatedAt   time.Time  `json:"created_at" db:"created_at"`
	UserID      uuid.UUID  `json:"user_id" db:"user_id"`
	SurveyID    nulls.UUID `json:"survey_id" db:"survey_id"`
	CollectorID nulls.UUID `json:"collector_id" db:"collector_id"`
}

SurveyResponse holds the survey responses and ids

func (SurveyResponse) String

func (s SurveyResponse) String() string

String is not required by pop and may be deleted

func (SurveyResponse) TableName

func (SurveyResponse) TableName() string

TableName overrides the schema and table name

type Surveys

type Surveys []Survey

Surveys is not required by pop and may be deleted

func (Surveys) String

func (s Surveys) String() string

String is not required by pop and may be deleted

Jump to

Keyboard shortcuts

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