mongo

package
v0.0.0-...-0019fd3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SEQPADLEN int32 = 7
)

Variables

This section is empty.

Functions

func NewMongoAdapter

func NewMongoAdapter(uri string, database string) (adapter.Adapter, error)

func NewMongoInfrastructureRepository

func NewMongoInfrastructureRepository(database *mongo.Database) repository.InfrastructureRepository

func NewMongoSequenceRepository

func NewMongoSequenceRepository(database *mongo.Database) repository.SequenceRepository

------------------------------------------------------------------------ * * ---------------------------------------------------------------------

Types

type MongoAdapter

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

func (*MongoAdapter) GetInfrastructureRepository

func (a *MongoAdapter) GetInfrastructureRepository() repository.InfrastructureRepository

func (*MongoAdapter) GetSequenceRepository

func (a *MongoAdapter) GetSequenceRepository() repository.SequenceRepository

type MongoInfrastructureRepository

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

func (*MongoInfrastructureRepository) DeleteBounds

func (r *MongoInfrastructureRepository) DeleteBounds(bounds *infrastructure.Bounds) error

func (*MongoInfrastructureRepository) FindBoundsById

func (*MongoInfrastructureRepository) InsertBounds

func (r *MongoInfrastructureRepository) InsertBounds(bounds *infrastructure.Bounds) error

func (*MongoInfrastructureRepository) ListAllBounds

func (r *MongoInfrastructureRepository) ListAllBounds() ([]*infrastructure.Bounds, error)

func (*MongoInfrastructureRepository) UpdateBounds

func (r *MongoInfrastructureRepository) UpdateBounds(bounds *infrastructure.Bounds) error

type MongoSequenceRepository

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

func (*MongoSequenceRepository) CreateSequence

func (r *MongoSequenceRepository) CreateSequence(prefix string, padding int) error

------------------------------------------------------------------------ * * ---------------------------------------------------------------------

func (*MongoSequenceRepository) DeleteAllSequences

func (r *MongoSequenceRepository) DeleteAllSequences() error

------------------------------------------------------------------------ * * ---------------------------------------------------------------------

func (*MongoSequenceRepository) DeleteSequence

func (r *MongoSequenceRepository) DeleteSequence(prefix string) error

------------------------------------------------------------------------ * * ---------------------------------------------------------------------

func (*MongoSequenceRepository) Next

func (r *MongoSequenceRepository) Next(prefix string, seperator string) sequence.Sequence

------------------------------------------------------------------------ * The sequence collection has the following properties: * seq{_id:"PREFIX",pad: xxx, seq:xxx} * Because of upsert, an error can occure. Outcomes could be: * - Exactly one findAndModify() would successfully insert a new document. * - Zero or more findAndModify() methods would update the newly inserted document. * - Zero or more findAndModify() methods would fail when they attempted to insert a duplicate. * If the method fails due to a unique index constraint violation, retry the method. Absent a * delete of the document, the retry should not fail. * ---------------------------------------------------------------------

func (*MongoSequenceRepository) ResetSequence

func (r *MongoSequenceRepository) ResetSequence(prefix string) error

------------------------------------------------------------------------ * * ---------------------------------------------------------------------

Jump to

Keyboard shortcuts

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