model

package
v0.0.0-...-32b26f9 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileContent

type FileContent uint8
const (
	FileContentGene FileContent = iota
	FileContentCompound
)

func (FileContent) String

func (p FileContent) String() string

func (*FileContent) UnmarshalJSON

func (p *FileContent) UnmarshalJSON(data []byte) error

type FileFormat

type FileFormat uint8
const (
	FileFormatCSV FileFormat = iota
	FileFormatTSV
)

func (FileFormat) String

func (p FileFormat) String() string

func (*FileFormat) UnmarshalJSON

func (p *FileFormat) UnmarshalJSON(data []byte) error

type FileUploadMetadata

type FileUploadMetadata struct {
	ID   uuid.UUID `db:"id" json:"id"`
	Name string    `db:"name" json:"name"`
	// Format   FileFormat  `db:"file_format" json:"format" sql:"type:file_format"`
	// Content  FileContent `db:"file_content" json:"content" sql:"type:file_content"`
	Format    string    `db:"file_format" json:"format" sql:"type:file_format"`
	Content   string    `db:"file_content" json:"content" sql:"type:file_content"`
	Organism  string    `db:"organism" json:"organism"`
	Owner     User      `db:"owner" json:"owner"`
	Size      int64     `db:"size" json:"size"`
	Checksum  []byte    `db:"checksum" json:"checksum"`
	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}

type FileUploadRequest

type FileUploadRequest struct {
	ID       uuid.UUID
	Name     string
	Format   FileFormat  `db:"file_format" json:"format" sql:"type:file_format"`
	Content  FileContent `db:"file_content" json:"content" sql:"type:file_content"`
	Organism string
	Owner    sql.NullInt64
	Session  string
	Token    string `db:"-"`
}

func (*FileUploadRequest) StoreRequest

func (p *FileUploadRequest) StoreRequest() error

type Kegg

type Kegg interface {
	File() string
	FromRecord([]string) (*Kegg, error)
	Create(...Kegg) error
	Initialize() error
	Finalize() error
}

type OrgPathway

type OrgPathway struct {
	Code   string    `db:"code"`
	PathID PathwayID `db:"path_id"`
}

func (OrgPathway) Create

func (p OrgPathway) Create(organisms ...Kegg) error

func (OrgPathway) File

func (p OrgPathway) File() string

func (OrgPathway) Finalize

func (p OrgPathway) Finalize() error

func (OrgPathway) FromRecord

func (p OrgPathway) FromRecord(record []string) (*Kegg, error)

func (OrgPathway) Initialize

func (p OrgPathway) Initialize() error

type Organism

type Organism struct {
	ID     OrganismID    `json:"id"`
	Code   string        `json:"code"`
	Name   string        `json:"name"`
	Common db.NullString `json:"common,omitempty"`
	Tax    string        `json:"-" db:"-"`
	Hidden bool          `json:"-"`
}

func (Organism) Create

func (p Organism) Create(organisms ...Kegg) error

func (Organism) Default

func (p Organism) Default() ([]Organism, error)

func (Organism) File

func (p Organism) File() string

func (Organism) Finalize

func (p Organism) Finalize() error

func (Organism) FromRecord

func (p Organism) FromRecord(record []string) (*Kegg, error)

func (Organism) Initialize

func (p Organism) Initialize() error

func (*Organism) MarshalJSON

func (p *Organism) MarshalJSON() ([]byte, error)

func (Organism) Search

func (p Organism) Search(query string) ([]Organism, error)

type OrganismID

type OrganismID int

func (OrganismID) MarshalJSON

func (p OrganismID) MarshalJSON() ([]byte, error)

MarshalJSON foo

func (*OrganismID) UnmarshalJSON

func (p *OrganismID) UnmarshalJSON(data []byte) error

UnmarshalJSON foo

type Pathway

type Pathway struct {
	// Serial int       `db:"serial" json:"-"`
	ID   PathwayID `db:"id" json:"id"`
	Name string    `db:"name" json:"name"`
}

Pathway foo

func (Pathway) Create

func (p Pathway) Create(pathways ...Kegg) error

func (Pathway) Default

func (p Pathway) Default(organism int) ([]Pathway, error)

func (Pathway) File

func (p Pathway) File() string

func (Pathway) Finalize

func (p Pathway) Finalize() error

func (Pathway) FromRecord

func (p Pathway) FromRecord(record []string) (*Kegg, error)

func (Pathway) Initialize

func (p Pathway) Initialize() error

func (Pathway) Search

func (p Pathway) Search(query string, organism int) ([]Pathway, error)

type PathwayID

type PathwayID int

func (PathwayID) MarshalJSON

func (p PathwayID) MarshalJSON() ([]byte, error)

MarshalJSON foo

func (*PathwayID) UnmarshalJSON

func (p *PathwayID) UnmarshalJSON(data []byte) error

UnmarshalJSON foo

type User

type User struct {
	ID            int64     `db:"id" json:"-" `
	Name          string    `db:"name" json:"name,omitempty"` // TODO: Nullable
	Email         string    `db:"email" json:"email"`
	EmailVerified bool      `db:"email_verified" json:"-"` // TODO: Nullable
	Provider      string    `db:"provider" json:"-"`
	ProviderID    string    `db:"provider_id" json:"-"`
	CreatedAt     time.Time `db:"created_at" json:"created_at,omitempty"`
	UpdatedAt     time.Time `db:"updated_at" json:"updated_at,omitempty"`
}

func (*User) Create

func (p *User) Create() error

func (*User) Login

func (p *User) Login(claims jwt.MapClaims) error

func (*User) Update

func (p *User) Update() error

Jump to

Keyboard shortcuts

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