dao

package
v0.0.0-...-e60c9d6 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CATEGORY1 CategoryType = "category1"
	CATEGORY2              = "category2"
	CATEGORY3              = "category3"
)

Variables

View Source
var BJLoc, _ = time.LoadLocation("Asia/Shanghai")

Functions

func BatchInsertMoleculars

func BatchInsertMoleculars(
	ctx context.Context, client *mongo.Client, collection *mongo.Collection,
	moleculars []*Molecular) error

func DeleteMolecular

func DeleteMolecular(
	ctx context.Context, collection *mongo.Collection,
	Fingerprint string) (err error)

func InsertMolecular

func InsertMolecular(
	ctx context.Context, collection *mongo.Collection, molecular *Molecular) error

Types

type CategoryType

type CategoryType string

type Molecular

type Molecular struct {
	ID        primitive.ObjectID `bson:"_id"`
	CreatedAt time.Time          `bson:"created_at"`
	UpdatedAt time.Time          `bson:"updated_at"`
	Deleted   bool               `bson:"deleted"`

	Fingerprint string            `bson:"fingerprint"`
	Title       string            `bson:"title,omitempty"`
	Category    CategoryType      `bson:"category,omitempty"`
	Attributes  map[string]string `bson:"attributes,omitempty"`
	Tags        []string          `bson:"tags,omitempty"`
}

func NewMolecular

func NewMolecular() (*Molecular, error)

Jump to

Keyboard shortcuts

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