Documentation
¶
Index ¶
- func Create(ctx context.Context, dbConn *db.MongoDB, passage *passagesv2.Passage) (*passagesv2.Passage, error)
- func Delete(ctx context.Context, mg *db.MongoDB, passage *passagesv2.Passage) error
- func EnsureIndex(ctx context.Context, dbConn *db.MongoDB) error
- func Id(i string) func(*ListOpts)
- func Lang(s string) func(*ListOpts)
- func Limit(i int) func(*ListOpts)
- func List(ctx context.Context, mg *db.MongoDB, optionsList ...func(*ListOpts)) (*passagesv2.PassageList, error)
- func NewListOpts() []func(*ListOpts)
- func Offset(i int) func(*ListOpts)
- type ListOpts
- type Passage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(ctx context.Context, dbConn *db.MongoDB, passage *passagesv2.Passage) (*passagesv2.Passage, error)
Create inserts a new passage into the database.
func EnsureIndex ¶
EnsureIndex in mongodb.
func List ¶
func List(ctx context.Context, mg *db.MongoDB, optionsList ...func(*ListOpts)) (*passagesv2.PassageList, error)
List returns a list of passages by passage query.
func NewListOpts ¶
func NewListOpts() []func(*ListOpts)
Types ¶
type ListOpts ¶
ListOpts implements passage's list options struct.
func DefaultOpts ¶
func DefaultOpts() ListOpts
type Passage ¶
type Passage struct { ID primitive.ObjectID `bson:"_id" json:"id"` Text string `json:"text" bson:"text"` Language string `json:"language" bson:"language"` Type passagesv2.PassageType `json:"type" bson:"type"` }
Passage to Trim
Click to show internal directories.
Click to hide internal directories.