repo

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cursor

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

func (*Cursor) Close

func (c *Cursor) Close(ctx context.Context) error

func (*Cursor) Decode

func (c *Cursor) Decode(val interface{}) error

func (*Cursor) Err

func (c *Cursor) Err() error

func (*Cursor) Next

func (c *Cursor) Next(ctx context.Context) bool

type ICursor

type ICursor interface {
	Close(ctx context.Context) error
	Next(ctx context.Context) bool
	Decode(val interface{}) error
	Err() error
}

type IRepo

type IRepo interface {
	Init(opts *option.Options) error
	Find(collection string, ctx context.Context, filter interface{}, opts ...*options.FindOptions) (ICursor, error)
	GetIndexes(ctx context.Context, collection string) ([]Indexes, error)
}

func NewRepo

func NewRepo() IRepo

type Indexes

type Indexes struct {
	Name                    string      `bson:"name"`
	TwoDSphereIndexVersion  interface{} `bson:"2dsphereIndexVersion"`
	Key                     bson.D      `bson:"key"`
	PartialFilterExpression bson.D      `bson:"partialFilterExpression"`
	Sparse                  bool        `bson:"sparse"`
	Weights                 interface{} `bson:"weights"`
	Collation               interface{} `bson:"collation"`
	ExpireAfterSeconds      interface{} `bson:"expireAfterSeconds"`
}

func (*Indexes) GetKey

func (i *Indexes) GetKey() bson.D

func (*Indexes) GetName

func (i *Indexes) GetName() string

func (*Indexes) GetPartialExpression

func (i *Indexes) GetPartialExpression() bson.D

func (*Indexes) IsCustomCollationEnabled

func (i *Indexes) IsCustomCollationEnabled() bool

func (*Indexes) IsGeoSpatial

func (i *Indexes) IsGeoSpatial() bool

func (*Indexes) IsSparse

func (i *Indexes) IsSparse() bool

func (*Indexes) IsTTL

func (i *Indexes) IsTTL() bool

func (*Indexes) IsText

func (i *Indexes) IsText() bool

func (*Indexes) NotSupported

func (i *Indexes) NotSupported() error

type Repo

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

func (*Repo) Find

func (r *Repo) Find(collection string, ctx context.Context, filter interface{}, opts ...*options.FindOptions) (ICursor, error)

func (*Repo) GetIndexes

func (r *Repo) GetIndexes(ctx context.Context, collection string) ([]Indexes, error)

func (*Repo) Init

func (r *Repo) Init(opts *option.Options) error

Jump to

Keyboard shortcuts

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