Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MongoRequest ¶
type MongoRequest struct { ID string `json:"id" bson:"_id"` // Private field for ID ExternalID string `json:"externalid" bson:"externalid"` Request se.Request `json:"request"` Topic string `json:"topic" bson:"topic"` //optional Status MongoStatus `json:"mongostatus" bson:"mongostatus"` Created time.Time `json:"created" bson:"created"` Updated time.Time `json:"updated" bson:"updated"` }
func Fetch ¶
func Fetch(cl *mongo.Collection, id, externalid, topic string, status MongoStatus) ([]MongoRequest, error)
Pass any string as "" for id, externalid, topic to be ignored for filter and status as MongoStatusAny to ignore
func NewMongoRequest ¶
func NewMongoRequest(req se.Request) *MongoRequest
func (*MongoRequest) Delete ¶
func (m *MongoRequest) Delete(cl *mongo.Collection) error
func (*MongoRequest) Save ¶
func (m *MongoRequest) Save(cl *mongo.Collection) error
This will insert only.
func (*MongoRequest) Update ¶
func (m *MongoRequest) Update(cl *mongo.Collection) error
This will update or insert based on if the id exists or not
type MongoStatus ¶
type MongoStatus string
const ( MongoStatusAny MongoStatus = "" MongoStatusNew MongoStatus = "new" MongoStatusProcessed MongoStatus = "processed" )
Click to show internal directories.
Click to hide internal directories.