model

package
v0.0.0-...-9fc6fd2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmail

func IsEmail(value interface{}) error

IsEmail validates an email address. The code is from github.com/asaskevich/govalidator, however govalidator also attempts to validate that the host exists. That check was not something we needed.

Types

type AddBackgroundProcessModel

type AddBackgroundProcessModel struct {
	UserID             string `db:"user_id" json:"user_id" r:"user_id"`
	ProjectID          string `db:"project_id" json:"project_id" r:"project_id"`
	BackgroundTaskID   string `db:"background_task_id" json:"background_task_id" r:"background_task_id"`
	BackgroundTaskType string `db:"background_task_type" json:"background_task_type" r:"background_task_type"`
	Status             string `db:"status" json:"status" r:"status"`
	Message            string `db:"message" json:"message" r:"message"`
}

type AddDatadirModel

type AddDatadirModel struct {
	Name      string `json:"name"`
	Owner     string `json:"owner"`
	Parent    string
	ProjectID string
}

func (AddDatadirModel) Validate

func (d AddDatadirModel) Validate() error

type AddDatafileModel

type AddDatafileModel struct {
	Name        string `json:"name"`
	Owner       string `json:"owner"`
	Checksum    string
	Description string `json:"description"`
	UsesID      string
	Parent      string
	Size        int64
	ProjectID   string
	DatadirID   string
	MediaType   DatafileMediaType
}

func (AddDatafileModel) Validate

func (d AddDatafileModel) Validate() error

type AddFileLoadModel

type AddFileLoadModel struct {
	ProjectID      string
	Path           string
	Owner          string
	Exclude        []string
	GlobusUploadID string
}

func (AddFileLoadModel) Validate

func (m AddFileLoadModel) Validate() error

type AddGlobusUploadModel

type AddGlobusUploadModel struct {
	ID               string
	Owner            string
	Path             string
	ProjectID        string
	GlobusAclID      string
	GlobusEndpointID string
	GlobusIdentityID string
}

func (AddGlobusUploadModel) Validate

func (m AddGlobusUploadModel) Validate() error

type AddProjectModel

type AddProjectModel struct {
	Name        string
	Owner       string
	Description string
}

func (AddProjectModel) Validate

func (p AddProjectModel) Validate() error

type AddUserModel

type AddUserModel struct {
	Email    string `json:"email"`
	Fullname string `json:"fullname"`
	Password string `json:"password"`
}

func (AddUserModel) Validate

func (u AddUserModel) Validate() error

type BackgroundProcessSchema

type BackgroundProcessSchema struct {
	ModelSimple
	UserID             string `db:"user_id" json:"user_id" r:"user_id"`
	ProjectID          string `db:"project_id" json:"project_id" r:"project_id"`
	BackgroundTaskID   string `db:"background_task_id" json:"background_task_id" r:"background_task_id"`
	BackgroundTaskType string `db:"background_task_type" json:"background_task_type" r:"background_task_type"`
	Status             string `db:"status" json:"status" r:"status"`
	Message            string `db:"message" json:"message" r:"message"`
	IsFinished         bool   `db:"is_finished" json:"is_finished" r:"is_finished"`
	IsOk               bool   `db:"is_ok" json:"is_ok" r:"is_ok"`
}

type DatadirEntryModel

type DatadirEntryModel struct {
	DatadirSimpleModel
	Directories []DatadirSimpleModel  `json:"directories" r:"directories"`
	Files       []DatafileSimpleModel `json:"files" r:"files"`
}

type DatadirSchema

type DatadirSchema struct {
	Model
	Parent   string `db:"parent" json:"parent" r:"parent"`
	Project  string `db:"project" json:"project" r:"project"`
	Shortcut bool   `db:"shortcut" json:"shortcut" r:"shortcut"`
}

type DatadirSimpleModel

type DatadirSimpleModel struct {
	ID   string `db:"id" json:"id" r:"id"`
	Name string `db:"name" json:"name" r:"name"`
}

type DatafileMediaType

type DatafileMediaType struct {
	Description string `db:"description" json:"description" r:"description"`
	Mime        string `db:"mime" json:"mime" r:"mime"`
}

type DatafileSchema

type DatafileSchema struct {
	Model
	Checksum    string            `db:"checksum" json:"checksum" r:"checksum"`
	Current     bool              `db:"current" json:"current" r:"current"`
	Description string            `db:"description" json:"description" r:"description"`
	MediaType   DatafileMediaType `json:"mediatype" r:"mediatype"`
	Parent      string            `db:"parent" json:"parent" r:"parent"`
	Size        int64             `db:"size" json:"size" r:"size"`
	Uploaded    int               `db:"uploaded" json:"uploaded" r:"uploaded"`
	UsesID      string            `db:"usesid" json:"usesid" r:"usesid"`
}

type DatafileSimpleModel

type DatafileSimpleModel struct {
	ID      string `json:"id" r:"id"`
	Name    string `json:"name" r:"name"`
	UsesID  string `json:"usesid" r:"usesid"`
	Size    int64  `json:"size" r:"size"`
	Current bool   `db:"current" json:"current" r:"current"`
}

func (DatafileSimpleModel) FirstMCDirPath

func (m DatafileSimpleModel) FirstMCDirPath() string

type DatasetSchema

type DatasetSchema struct {
	ModelSimple
	SelectionID   string            `json:"selection_id" r:"selection_id"`
	Title         string            `json:"title" r:"title"`
	Owner         string            `json:"owner" r:"owner"`
	DOI           string            `json:"doi" r:"doi"`
	Published     bool              `json:"published" r:"published"`
	FileSelection FileSelection     `json:"file_selection" r:"file_selection"`
	Zip           DatasetZipDetails `json:"zip" r:"zip""`
}

type DatasetZipDetails

type DatasetZipDetails struct {
	Size     int64  `json:"size" r:"size"`
	Filename string `json:"filename" r:"filename"`
}

type Experiment2Sample

type Experiment2Sample struct {
	ExperimentID string `db:"experiment_id" json:"experiment_id"`
	SampleID     string `db:"sample_id" json:"sample_id"`
}

type ExperimentOverviewModel

type ExperimentOverviewModel struct {
	ExperimentSchema
	FilesCount   int `db:"files_count" json:"files_count" r:"files_count"`
	SamplesCount int `db:"samples_count" json:"samples_count" r:"samples_count"`
	ProcessCount int `db:"process_count" json:"process_count" r:"process_count"`
}

type ExperimentSchema

type ExperimentSchema struct {
	Model
	Description  string       `db:"description" json:"description"`
	Status       string       `db:"status" json:"status"`
	OwnerDetails OwnerDetails `json:"owner_details" r:"owner_details"`
}

type FileLoadSchema

type FileLoadSchema struct {
	ModelSimple
	ProjectID      string   `db:"project_id" json:"project_id" r:"project_id"`
	Path           string   `db:"path" json:"path" r:"path"`
	Owner          string   `db:"owner" json:"owner" r:"owner"`
	Exclude        []string `json:"exclude" r:"exclude"`
	Loading        bool     `db:"loading" json:"loading" r:"loading"`
	GlobusUploadID string   `db:"globus_upload_id" json:"globus_upload_id" r:"globus_upload_id"`
}

type FileSelection

type FileSelection struct {
	ID           string   `json:"id" r:"id"`
	IncludeFiles []string `json:"include_files" r:"include_files"`
	ExcludeFiles []string `json:"exclude_files" r:"exclude_files"`
	IncludeDirs  []string `json:"include_dirs" r:"include_dirs"`
	ExcludeDirs  []string `json:"exclude_dirs" r:"exclude_dirs"`
}

type GetListBackgroundProcessModel

type GetListBackgroundProcessModel struct {
	UserID           string `db:"user_id" json:"user_id" r:"user_id"`
	ProjectID        string `db:"project_id" json:"project_id" r:"project_id"`
	BackgroundTaskID string `db:"background_process_id" json:"background_process_id" r:"background_process_id"`
}

type GlobusUploadSchema

type GlobusUploadSchema struct {
	ModelSimpleNoID
	ID               string `db:"id" json:"id" r:"id"`
	Owner            string `db:"owner" json:"owner" r:"owner"`
	Path             string `db:"path" json:"path" r:"path"`
	ProjectID        string `db:"project_id" json:"project_id" r:"project_id"`
	GlobusAclID      string `db:"globus_acl_id" json:"globus_acl_id" r:"globus_acl_id"`
	GlobusEndpointID string `db:"globus_endpoint_id" json:"globus_endpoint_id" r:"globus_endpoint_id"`
	GlobusIdentityID string `db:"globus_identity_id" json:"globus_identity_id" r:"globus_identity_id"`
}

type MarkOKBackgroundProcessModel

type MarkOKBackgroundProcessModel struct {
	IsOk bool `db:"is_ok" json:"is_ok" r:"is_ok"`
}

type Model

type Model struct {
	ID        string    `db:"id" json:"id" r:"id,omitempty"`
	Birthtime time.Time `db:"birthime" json:"birthtime" r:"birthtime"`
	MTime     time.Time `db:"mtime" json:"mtime" r:"mtime"`
	Name      string    `db:"name" json:"name" r:"name"`
	Owner     string    `db:"owner" json:"owner" r:"owner"`
	OType     string    `db:"otype" json:"otype" r:"otype"`
}

type ModelSimple

type ModelSimple struct {
	ID        string    `db:"id" json:"id" r:"id,omitempty"`
	Birthtime time.Time `db:"birthtime" json:"birthtime" r:"birthtime"`
	MTime     time.Time `db:"mtime" json:"mtime" r:"mtime"`
	OType     string    `db:"otype" json:"otype" r:"otype"`
}

type ModelSimpleNoID

type ModelSimpleNoID struct {
	Birthtime time.Time `db:"birthtime" json:"birthtime" r:"birthtime"`
	MTime     time.Time `db:"mtime" json:"mtime" r:"mtime"`
	OType     string    `db:"otype" json:"otype" r:"otype"`
}

type OwnerDetails

type OwnerDetails struct {
	Fullname string `json:"fullname" r:"fullname"`
}

type Process2Sample

type Process2Sample struct {
	SampleID      string `db:"sample_id" json:"sample_id"`
	PropertySetID string `db:"property_set_id" json:"property_set_id"`
	ProcessID     string `db:"process_id" json:"process_id"`
	Direction     string `db:"direction" json:"direction"`
}

type ProcessExtendedModel

type ProcessExtendedModel struct {
	ProcessSchema
	Setup         ProcessSetup         `json:"setup"`
	InputSamples  []ProcessSample      `json:"input_samples"`
	OutputSamples []ProcessSample      `json:"output_samples"`
	Measurements  []ProcessMeasurement `json:"measurements"`
}

type ProcessMeasurement

type ProcessMeasurement struct {
}

type ProcessSample

type ProcessSample struct {
}

type ProcessSchema

type ProcessSchema struct {
	Model
	DoesTransform bool   `db:"does_transform" json:"does_transform"`
	Note          string `db:"note" json:"note"`
	ProcessType   string `db:"process_type" json:"process_type"`
	TemplateID    string `db:"template_id" json:"template_id"`
	TemplateName  string `db:"template_name" json:"template_name"`
}

type ProcessSetup

type ProcessSetup struct {
}

type ProjectAccessModel

type ProjectAccessModel struct {
	ID            string                `json:"id" r:"id"`
	Owner         string                `json:"owner" r:"owner"`
	AccessEntries []ProjectAccessSchema `json:"access_entries" r:"access_entries"`
}

type ProjectAccessSchema

type ProjectAccessSchema struct {
	ID        string    `json:"id" r:"id"`
	UserID    string    `json:"user_id" r:"user_id"`
	Birthtime time.Time `json:"birthtime" r:"birthtime"`
	ProjectID string    `json:"project_id" r:"project_id"`
}

type ProjectCountModel

type ProjectCountModel struct {
	ProjectSchema
	OwnerDetails     OwnerDetails `json:"owner_details" r:"owner_details"`
	FilesCount       int          `json:"files_count" r:"files_count"`
	UsersCount       int          `json:"users_count" r:"users_count"`
	SamplesCount     int          `json:"samples_count" r:"samples_count"`
	ProcessesCount   int          `json:"processes_count" r:"processes_count"`
	ExperimentsCount int          `json:"experiments_count" r:"experiments_count"`
	DatasetsCount    int          `json:"datasets_count" r:"datasets_count"`
}

type ProjectExtendedModel

type ProjectExtendedModel struct {
	ProjectSchema
	FilesCount    int                  `json:"files_count" r:"files_count"`
	Users         []ProjectUserModel   `json:"users" r:"users"`
	Samples       []SampleSchema       `json:"samples" r:"samples"`
	Processes     []ProcessSchema      `json:"processes" r:"processes"`
	Experiments   []ExperimentSchema   `json:"experiments" r:"experiments"`
	Relationships ProjectRelationships `json:"relationships" r:"relationships"`
}

type ProjectNote

type ProjectNote struct {
	ModelSimple
	Note  string `json:"note" r:"note"`
	Owner string `json:"owner" r:"owner"`
	Title string `json:"title" r:"title"`
}

type ProjectOverviewModel

type ProjectOverviewModel struct {
	ProjectSchema
	Shortcuts      []ProjectShortcut         `json:"shortcuts" r:"shortcuts"`
	RootDir        []DatadirSimpleModel      `json:"root_dir" r:"root_dir"`
	OwnerDetails   OwnerDetails              `json:"owner_details" r:"owner_details"`
	FilesCount     int                       `json:"files_count" r:"files_count"`
	UsersCount     int                       `json:"users_count" r:"users_count"`
	SamplesCount   int                       `json:"samples_count" r:"samples_count"`
	ProcessesCount int                       `json:"processes_count" r:"processes_count"`
	DatasetsCount  int                       `json:"datasets_count" r:"datasets_count"`
	Experiments    []ExperimentOverviewModel `json:"experiments" r:"experiments"`
	Todos          []ProjectTodo             `json:"todos" r:"todos"`
}

type ProjectRelationships

type ProjectRelationships struct {
	Process2Sample    []Process2Sample    `json:"process2sample" r:"process2sample"`
	Experiment2Sample []Experiment2Sample `json:"experiment2sample" r:"experiment2sample"`
}

type ProjectSchema

type ProjectSchema struct {
	Model
	Description string `db:"description" json:"description" r:"description"`
}

type ProjectShortcut

type ProjectShortcut struct {
	Name string `json:"name" r:"name"`
	ID   string `json:"id" r:"id"`
}

type ProjectSimpleModel

type ProjectSimpleModel struct {
	ProjectSchema
	RootDir []DatadirSchema `json:"root_dir" r:"root_dir"`
}

type ProjectTodo

type ProjectTodo struct {
	Title string `json:"title" r:"title"`
	Edit  bool   `json:"edit" r:"edit"`
	Done  bool   `json:"done" r:"done"`
}

type ProjectUserAccessModel

type ProjectUserAccessModel struct {
	ProjectAccessSchema
	Fullname string `json:"fullname" r:"fullname"`
}

type ProjectUserModel

type ProjectUserModel struct {
	ModelSimple
	BetaUser  bool   `db:"beta_user" json:"beta_user" r:"beta_user"`
	Fullname  string `db:"fullname" json:"fullname" r:"fullname"`
	ProjectID string `db:"project_id" json:"project_id" r:"project_id"`
	UserID    string `db:"user_id" json:"user_id" r:"user_id"`
}

type SampleSchema

type SampleSchema struct {
	Model
	Description string `db:"description" json:"description"`
}

type UpdateBackgroundProcessModel

type UpdateBackgroundProcessModel struct {
	Status  string `db:"status" json:"status" r:"status"`
	Message string `db:"message" json:"message" r:"message"`
}

type UserSchema

type UserSchema struct {
	ModelSimpleNoID
	ID              string    `db:"id" json:"id" r:"id"`
	Admin           bool      `db:"admin" json:"admin" r:"admin"`
	APIKey          string    `db:"apikey" json:"-" r:"apikey"`
	BetaUser        bool      `db:"beta_user" json:"beta_user" r:"beta_user"`
	DemoInstalled   bool      `db:"demo_installed" json:"demo_installed" r:"demo_installed"`
	Email           string    `db:"email" json:"email" r:"email"`
	Fullname        string    `db:"fullname" json:"fullname" r:"fullname"`
	Password        string    `db:"password" json:"-" r:"password"`
	IsTemplateAdmin bool      `db:"is_template_admin" json:"is_template_admin" r:"is_template_admin"`
	LastLogin       time.Time `db:"last_login" json:"last_login" r:"last_login"`
	GlobusUser      string    `db:"globus_user" json:"globus_user" r:"globus_user"`
}

Jump to

Keyboard shortcuts

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