mcmodel

package
v0.0.0-...-aeff70a Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 10 Imported by: 10

Documentation

Index

Constants

View Source
const (
	ValueTypeUnset          = 0
	ValueTypeInt            = 1
	ValueTypeFloat          = 2
	ValueTypeString         = 3
	ValueTypeComplex        = 4
	ValueTypeArrayOfInt     = 5
	ValueTypeArrayOfFloat   = 6
	ValueTypeArrayOfString  = 7
	ValueTypeArrayOfComplex = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	ID         int         `json:"id"`
	Name       string      `json:"name"`
	Attributes []Attribute `json:"attributes" gorm:"-"`
}

type Attribute

type Attribute struct {
	ID               int              `json:"id"`
	UUID             string           `json:"uuid"`
	Name             string           `json:"name"`
	AttributableID   int              `json:"attributable_id"`
	AttributableType string           `json:"attributable_type"`
	AttributeValues  []AttributeValue `json:"attribute_values"`
}

func (Attribute) GetValue

func (a Attribute) GetValue() interface{}

func (*Attribute) LoadValues

func (a *Attribute) LoadValues() error

type AttributeValue

type AttributeValue struct {
	ID                  int                      `json:"id"`
	UUID                string                   `json:"uuid"`
	AttributeID         int                      `json:"attribute_id"`
	Unit                string                   `json:"unit"`
	Val                 string                   `json:"val"`
	ValueType           int                      `json:"value_type" gorm:"-"`
	ValueInt            int64                    `json:"value_int" gorm:"-"`
	ValueFloat          float64                  `json:"value_float" gorm:"-"`
	ValueString         string                   `json:"value_string" gorm:"-"`
	ValueComplex        map[string]interface{}   `gorm:"-"`
	ValueArrayOfInt     []int64                  `gorm:"-"`
	ValueArrayOfFloat   []float64                `gorm:"-"`
	ValueArrayOfString  []string                 `gorm:"-"`
	ValueArrayOfComplex []map[string]interface{} `gorm:"-"`
}

type Conversion

type Conversion struct {
	ID                  int       `json:"id"`
	UUID                string    `json:"uuid"`
	ProjectID           int       `json:"project_id"`
	OwnerID             int       `json:"owner_id"`
	FileID              int       `json:"file_id"`
	CreatedAt           time.Time `json:"created_at"`
	UpdatedAt           time.Time `json:"updated_at"`
	ConversionStartedAt time.Time `json:"conversion_started_at"`
}

func (Conversion) TableName

func (Conversion) TableName() string

type Dataset

type Dataset struct {
	ID            int    `json:"id"`
	Name          string `json:"name"`
	UUID          string `json:"uuid"`
	ProjectID     int    `json:"project_id"`
	License       string `json:"license"`
	LicenseLink   string `json:"license_link"`
	Description   string `json:"description"`
	Summary       string `json:"summary"`
	DOI           string `json:"doi"`
	Authors       string `json:"authors"`
	Files         []File `json:"files" gorm:"many2many:dataset2file"`
	FileSelection string
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	PublishedAt   time.Time `json:"published_at"`
}

func (Dataset) GetEntitiesFromTemplate

func (d Dataset) GetEntitiesFromTemplate(db *gorm.DB) ([]Entity, error)

func (Dataset) GetFileSelection

func (d Dataset) GetFileSelection() (*FileSelection, error)

func (Dataset) GetFiles

func (d Dataset) GetFiles(db *gorm.DB) *gorm.DB

func (Dataset) ZipfileDir

func (d Dataset) ZipfileDir(mcfsDir string) string

func (Dataset) ZipfilePath

func (d Dataset) ZipfilePath(mcfsDir string) string

type DirEntry

type DirEntry struct {
	// contains filtered or unexported fields
}

func (DirEntry) Info

func (d DirEntry) Info() (fs.FileInfo, error)

func (DirEntry) IsDir

func (d DirEntry) IsDir() bool

func (DirEntry) Name

func (d DirEntry) Name() string

func (DirEntry) Type

func (d DirEntry) Type() fs.FileMode

type Entity

type Entity struct {
	ID           int           `json:"id"`
	Name         string        `json:"name"`
	Files        []File        `json:"files" gorm:"many2many:entity2file"`
	EntityStates []EntityState `json:"entity_states"`
}

type EntityState

type EntityState struct {
	ID         int         `json:"id"`
	EntityID   int         `json:"entity_id"`
	Attributes []Attribute `json:"attributes" gorm:"-"`
}

type File

type File struct {
	ID                   int       `json:"id"`
	UUID                 string    `json:"uuid"`
	UsesUUID             string    `json:"uses_uuid"`
	UsesID               int       `json:"uses_id"`
	ProjectID            int       `json:"project_id"`
	Name                 string    `json:"name"`
	OwnerID              int       `json:"owner_id"`
	Path                 string    `json:"path"`
	DirectoryID          int       `json:"directory_id"`
	Size                 uint64    `json:"size"`
	Checksum             string    `json:"checksum"`
	MimeType             string    `json:"mime_type"`
	MediaTypeDescription string    `json:"media_type_description"`
	Current              bool      `json:"current"`
	Directory            *File     `json:"directory" gorm:"foreignKey:DirectoryID;references:ID"`
	CreatedAt            time.Time `json:"created_at"`
	UpdatedAt            time.Time `json:"updated_at"`
}

func (File) FullPath

func (f File) FullPath() string

func (File) IDForUses

func (f File) IDForUses() int

func (File) IsConvertible

func (f File) IsConvertible() bool

func (File) IsDir

func (f File) IsDir() bool

func (File) IsFile

func (f File) IsFile() bool

func (File) TableName

func (File) TableName() string

func (File) ToDirEntry

func (f File) ToDirEntry() DirEntry

func (File) ToFileInfo

func (f File) ToFileInfo() FileInfo

func (File) ToUnderlyingDirPath

func (f File) ToUnderlyingDirPath(mcdir string) string

func (File) ToUnderlyingFilePath

func (f File) ToUnderlyingFilePath(mcdir string) string

func (File) ToUnderlyingFilePathForUUID

func (f File) ToUnderlyingFilePathForUUID(mcdir string) string

func (File) UUIDForPath

func (f File) UUIDForPath() string

func (File) UUIDForUses

func (f File) UUIDForUses() string

type FileInfo

type FileInfo struct {
	// contains filtered or unexported fields
}

func (FileInfo) IsDir

func (f FileInfo) IsDir() bool

func (FileInfo) ModTime

func (f FileInfo) ModTime() time.Time

func (FileInfo) Mode

func (f FileInfo) Mode() fs.FileMode

func (FileInfo) Name

func (f FileInfo) Name() string

func (FileInfo) Size

func (f FileInfo) Size() int64

func (FileInfo) Sys

func (f FileInfo) Sys() interface{}

type FileSelection

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

type GlobusTransfer

type GlobusTransfer struct {
	ID                                int              `json:"id"`
	UUID                              string           `json:"string"`
	ProjectID                         int              `json:"project_id"`
	Name                              string           `json:"name"`
	State                             string           `json:"state"`
	OwnerID                           int              `json:"owner_id"`
	Owner                             *User            `gorm:"foreignKey:OwnerID;references:ID"`
	GlobusEndpointID                  string           `json:"globus_endpoint_id"`
	GlobusAclID                       string           `json:"globus_acl_id"`
	GlobusPath                        string           `json:"globus_path"`
	GlobusIdentityID                  string           `json:"globus_identity_id"`
	GlobusURL                         string           `json:"globus_url"`
	LastGlobusTransferIDCompleted     string           `gorm:"column:last_globus_transfer_id_completed" json:"last_globus_transfer_id_completed"`
	LatestGlobusTransferCompletedDate string           `json:"latest_globus_transfer_completed_date"`
	TransferRequestID                 int              `json:"transfer_request_id"`
	TransferRequest                   *TransferRequest `gorm:"foreignKey:TransferRequestID;references:ID"`
	CreatedAt                         time.Time        `json:"created_at"`
	UpdatedAt                         time.Time        `json:"updated_at"`
}

func (GlobusTransfer) TableName

func (GlobusTransfer) TableName() string

type Project

type Project struct {
	ID             int       `json:"id"`
	UUID           string    `json:"uuid"`
	Slug           string    `json:"slug"`
	Name           string    `json:"name"`
	TeamID         int       `json:"team_id"`
	OwnerID        int       `json:"owner_id"`
	Owner          *User     `json:"owner" gorm:"foreignKey:OwnerID;references:ID"`
	Size           int64     `json:"size"`
	FileCount      int       `json:"file_count"`
	DirectoryCount int       `json:"directory_count"`
	FileTypes      string    `json:"file_types"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

func (Project) GetFileTypes

func (p Project) GetFileTypes() (map[string]int, error)

func (Project) ToFileTypeAsString

func (p Project) ToFileTypeAsString(fileTypes map[string]int) (string, error)

type TransferRequest

type TransferRequest struct {
	ID             int             `json:"id"`
	UUID           string          `json:"uuid"`
	State          string          `json:"state"`
	ProjectID      int             `json:"project_id"`
	OwnerID        int             `json:"owner_id"`
	Owner          *User           `json:"owner" gorm:"foreignKey:OwnerID;references:ID"`
	GlobusTransfer *GlobusTransfer `json:"globus_transfer" gorm:"foreignKey:transfer_request_id;references:id"`
	LastActiveAt   time.Time       `json:"last_active_at"`
	CreatedAt      time.Time       `json:"created_at"`
	UpdatedAt      time.Time       `json:"updated_at"`
}

func (TransferRequest) TableName

func (TransferRequest) TableName() string

type TransferRequestFile

type TransferRequestFile struct {
	ID                int              `json:"id"`
	UUID              string           `json:"string"`
	Name              string           `json:"name"`
	State             string           `json:"state"`
	TransferRequestID int              `json:"transfer_request_id"`
	TransferRequest   *TransferRequest `gorm:"foreignKey:TransferRequestID;references:ID"`
	ProjectID         int              `json:"project_id"`
	DirectoryID       int              `json:"directory_id"`
	FileID            int              `json:"file_id"`
	File              *File            `gorm:"foreignKey:FileID;references:ID"`
	OwnerID           int              `json:"owner_id"`
	CreatedAt         time.Time        `json:"created_at"`
	UpdatedAt         time.Time        `json:"updated_at"`
}

func (TransferRequestFile) TableName

func (TransferRequestFile) TableName() string

type User

type User struct {
	ID         int    `json:"id"`
	UUID       string `json:"uuid"`
	Slug       string `json:"slug"`
	Name       string `json:"name"`
	Email      string `json:"email"`
	GlobusUser string `json:"globus_user"`
	ApiToken   string `json:"-"`
	Password   string `json:"-"`
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

Jump to

Keyboard shortcuts

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