node

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2014 License: BSD-2-Clause Imports: 24 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LockMgr = NewLocker()
)

Functions

func Initialize

func Initialize()

Initialize creates a copy of the mongodb connection and then uses that connection to create the Nodes collection in mongodb. Then, it ensures that there is a unique index on the id key in this collection, creating the index if necessary.

func IsInMappy

func IsInMappy(item string, mp mappy) bool

func ReloadFromDisk

func ReloadFromDisk(path string) (err error)

Types

type FormFile

type FormFile struct {
	Name     string
	Path     string
	Checksum map[string]string
}

type FormFiles

type FormFiles map[string]FormFile

type IdxInfo

type IdxInfo struct {
	Type        string `bson:"index_type" json:"-"`
	TotalUnits  int64  `bson:"total_units" json:"total_units"`
	AvgUnitSize int64  `bson:"average_unit_size" json:"average_unit_size"`
	Format      string `bson:"format" json:"-"`
}

type Indexes

type Indexes map[string]IdxInfo

type Locker

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

func NewLocker

func NewLocker() *Locker

func (*Locker) LockPartOp

func (l *Locker) LockPartOp()

func (*Locker) UnlockPartOp

func (l *Locker) UnlockPartOp()

type Node

type Node struct {
	Id           string            `bson:"id" json:"id"`
	Version      string            `bson:"version" json:"version"`
	File         file.File         `bson:"file" json:"file"`
	Attributes   interface{}       `bson:"attributes" json:"attributes"`
	Public       bool              `bson:"public" json:"public"`
	Indexes      Indexes           `bson:"indexes" json:"indexes"`
	Acl          acl.Acl           `bson:"acl" json:"-"`
	VersionParts map[string]string `bson:"version_parts" json:"-"`
	Tags         []string          `bson:"tags" json:"tags"`
	Revisions    []Node            `bson:"revisions" json:"-"`
	Linkages     []linkage         `bson:"linkage" json:"linkages"`
	CreatedOn    time.Time         `bson:"created_on" json:"created_on"`
	LastModified time.Time         `bson:"last_modified" json:"last_modified"`
	Type         string            `bson:"type" json:"type"`
	Subset       Subset            `bson:"subset" json:"-"`
}

func CreateNodeUpload

func CreateNodeUpload(u *user.User, params map[string]string, files FormFiles) (node *Node, err error)

func Load

func Load(id string, u *user.User) (n *Node, err error)

func LoadFromDisk

func LoadFromDisk(id string) (n *Node, err error)

func LoadUnauth

func LoadUnauth(id string) (n *Node, err error)

func New

func New() (node *Node)

func (*Node) Delete

func (node *Node) Delete() (err error)

func (*Node) DeleteIndex added in v0.8.5

func (node *Node) DeleteIndex(indextype string) (err error)

func (*Node) DynamicIndex added in v0.8.14

func (node *Node) DynamicIndex(name string) (idx index.Index, err error)

func (*Node) FileExt

func (node *Node) FileExt() string

func (*Node) FilePath

func (node *Node) FilePath() string

func (*Node) FileReader

func (node *Node) FileReader() (reader file.ReaderAt, err error)

func (*Node) HasFile

func (node *Node) HasFile() bool

has

func (*Node) HasIndex

func (node *Node) HasIndex(index string) bool

func (*Node) HasParent

func (node *Node) HasParent() bool

func (*Node) IndexPath

func (node *Node) IndexPath() string

func (*Node) Mkdir

func (node *Node) Mkdir() (err error)

func (*Node) Path

func (node *Node) Path() string

path

func (*Node) Rmdir

func (node *Node) Rmdir() (err error)

func (*Node) Save

func (node *Node) Save() (err error)

func (*Node) SetAttributes

func (node *Node) SetAttributes(attr FormFile) (err error)

func (*Node) SetAttributesFromString added in v0.8.5

func (node *Node) SetAttributesFromString(attributes string) (err error)

func (*Node) SetFile

func (node *Node) SetFile(file FormFile) (err error)

func (*Node) SetFileFormat

func (node *Node) SetFileFormat(format string) (err error)

func (*Node) SetFileFromParts

func (node *Node) SetFileFromParts(p *partsList, allowEmpty bool) (err error)

func (*Node) SetFileFromPath

func (node *Node) SetFileFromPath(path string, action string) (err error)

func (*Node) SetFileFromSubset added in v0.8.12

func (node *Node) SetFileFromSubset(subsetIndices FormFile) (err error)

func (*Node) SetIndexInfo

func (node *Node) SetIndexInfo(indextype string, idxinfo IdxInfo) (err error)

func (*Node) ToJson

func (node *Node) ToJson() (s string, err error)

func (*Node) Update

func (node *Node) Update(params map[string]string, files FormFiles) (err error)

Modification functions

func (*Node) UpdateDataTags

func (node *Node) UpdateDataTags(types string) (err error)

func (*Node) UpdateLinkages

func (node *Node) UpdateLinkages(ltype string, ids string, operation string) (err error)

func (*Node) UpdateVersion

func (node *Node) UpdateVersion() (err error)

type Nodes

type Nodes []*Node

Node array type

func LoadNodes

func LoadNodes(ids []string) (n Nodes, err error)

func (*Nodes) GetAll

func (n *Nodes) GetAll(q bson.M) (err error)

func (*Nodes) GetPaginated

func (n *Nodes) GetPaginated(q bson.M, limit int, offset int) (count int, err error)

type Parent added in v0.8.12

type Parent struct {
	Id        string `bson:"id" json:"-"`
	IndexName string `bson:"index_name" json:"-"`
}

type Subset added in v0.8.12

type Subset struct {
	Parent Parent            `bson:"parent" json:"-"`
	Index  SubsetNodeIdxInfo `bson:"index" json:"-"`
}

Subset is used to store information about a subset node's parent and its index. A subset node's index defines the subset of the data file that this node represents. A subset node's index is immutable after it is defined.

type SubsetNodeIdxInfo added in v0.8.13

type SubsetNodeIdxInfo struct {
	Path        string `bson:"path" json:"-"`
	TotalUnits  int64  `bson:"total_units" json:"-"`
	AvgUnitSize int64  `bson:"average_unit_size" json:"-"`
	Format      string `bson:"format" json:"-"`
}

Directories

Path Synopsis
Package contains Node File struct and MultiReaderAt implementation
Package contains Node File struct and MultiReaderAt implementation
format/fasta
Package to read and write FASTA format files
Package to read and write FASTA format files
format/fastq
Package to read and write FASTQ format files
Package to read and write FASTQ format files
format/line
Package to read and index lines of a file
Package to read and index lines of a file
format/multi
Package to read and auto-detect format of fasta & fastq files
Package to read and auto-detect format of fasta & fastq files
format/sam
Package to read and write SAM format files
Package to read and write SAM format files
format/seq
Package contains interfaces for fasta & fastq & and multi packages
Package contains interfaces for fasta & fastq & and multi packages

Jump to

Keyboard shortcuts

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