db

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	USED_SLOT_STATUS_RESERVED  = "reserved"
	USED_SLOT_STATUS_CONFIRMED = "confirmed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SelfSwabbingExtDBService

type SelfSwabbingExtDBService struct {
	DBClient *mongo.Client

	DBNamePrefix string
	// contains filtered or unexported fields
}

func NewSelfSwabbingExtDBService

func NewSelfSwabbingExtDBService(configs types.DBConfig) *SelfSwabbingExtDBService

func (*SelfSwabbingExtDBService) AddEntryCode

func (dbService *SelfSwabbingExtDBService) AddEntryCode(instanceID string, entryCode string) (string, error)

func (*SelfSwabbingExtDBService) CancelSlotReservation added in v0.2.0

func (dbService *SelfSwabbingExtDBService) CancelSlotReservation(instanceID string, participantID string) error

func (*SelfSwabbingExtDBService) CleanUpExpiredSlotReservations added in v0.2.0

func (dbService *SelfSwabbingExtDBService) CleanUpExpiredSlotReservations(instanceID string) error

func (*SelfSwabbingExtDBService) ConfirmSlot added in v0.2.0

func (dbService *SelfSwabbingExtDBService) ConfirmSlot(instanceID string, participantID string) error

func (*SelfSwabbingExtDBService) CountUsedCodes added in v0.4.0

func (dbService *SelfSwabbingExtDBService) CountUsedCodes(instanceID string) (count int64, err error)

func (*SelfSwabbingExtDBService) CreateIndexForEntryCodes

func (dbService *SelfSwabbingExtDBService) CreateIndexForEntryCodes(instanceID string) error

func (*SelfSwabbingExtDBService) CreateIndexesForSampler added in v0.2.0

func (dbService *SelfSwabbingExtDBService) CreateIndexesForSampler(instanceID string)

func (*SelfSwabbingExtDBService) FindEntryCodeInfo

func (dbService *SelfSwabbingExtDBService) FindEntryCodeInfo(instanceID string, code string) (entryCode types.ValidationCode, err error)

func (*SelfSwabbingExtDBService) GetUsedSlotsCountSince added in v0.2.0

func (dbService *SelfSwabbingExtDBService) GetUsedSlotsCountSince(instanceID string, ref int64) (count int64, err error)

func (*SelfSwabbingExtDBService) LoadLatestSlotCurve added in v0.2.0

func (dbService *SelfSwabbingExtDBService) LoadLatestSlotCurve(instanceID string) (res sampler.SlotCurve, err error)

func (*SelfSwabbingExtDBService) MarkEntryCodeAsUsed

func (dbService *SelfSwabbingExtDBService) MarkEntryCodeAsUsed(instanceID string, code string, usedBy string) (err error)

func (*SelfSwabbingExtDBService) ReserveSlot added in v0.2.0

func (dbService *SelfSwabbingExtDBService) ReserveSlot(instanceID string, participantID string) error

func (*SelfSwabbingExtDBService) SaveNewSlotCurve added in v0.2.0

func (dbService *SelfSwabbingExtDBService) SaveNewSlotCurve(instanceID string, obj sampler.SlotCurve) (err error)

type UsedSlot added in v0.2.0

type UsedSlot struct {
	Time          int64  `bson:"time" json:"time"`
	ParticipantID string `bson:"participantID" json:"participantID"`
	Status        string `bson:"status" json:"status"`
}

Jump to

Keyboard shortcuts

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