Documentation ¶
Index ¶
- Constants
- func NewMongoAdapter(uri string, database string) (adapter.Adapter, error)
- func NewMongoInfrastructureRepository(database *mongo.Database) repository.InfrastructureRepository
- func NewMongoSequenceRepository(database *mongo.Database) repository.SequenceRepository
- type MongoAdapter
- type MongoInfrastructureRepository
- func (r *MongoInfrastructureRepository) DeleteBounds(bounds *infrastructure.Bounds) error
- func (r *MongoInfrastructureRepository) FindBoundsById(id string) (*infrastructure.Bounds, error)
- func (r *MongoInfrastructureRepository) InsertBounds(bounds *infrastructure.Bounds) error
- func (r *MongoInfrastructureRepository) ListAllBounds() ([]*infrastructure.Bounds, error)
- func (r *MongoInfrastructureRepository) UpdateBounds(bounds *infrastructure.Bounds) error
- type MongoSequenceRepository
- func (r *MongoSequenceRepository) CreateSequence(prefix string, padding int) error
- func (r *MongoSequenceRepository) DeleteAllSequences() error
- func (r *MongoSequenceRepository) DeleteSequence(prefix string) error
- func (r *MongoSequenceRepository) Next(prefix string, seperator string) sequence.Sequence
- func (r *MongoSequenceRepository) ResetSequence(prefix string) error
Constants ¶
const (
SEQPADLEN int32 = 7
)
Variables ¶
This section is empty.
Functions ¶
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 (r *MongoInfrastructureRepository) FindBoundsById(id string) (*infrastructure.Bounds, error)
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
------------------------------------------------------------------------ * * ---------------------------------------------------------------------