Documentation ¶
Index ¶
- Variables
- type CrashTable
- type LogTable
- type MongoTable
- func (m MongoTable) Add(v any) (string, error)
- func (m MongoTable) AddCrash(c crash.Individual) error
- func (m MongoTable) Contains(values map[string]any) (bool, error)
- func (m MongoTable) Count(filter map[string]any) (int64, error)
- func (m MongoTable) Delete(key string) error
- func (m MongoTable) Find(values map[string]any, v any) (err error)
- func (m MongoTable) FindMany(values map[string]any, v any) (err error)
- func (m MongoTable) Get(key string, v any) error
- func (m MongoTable) Has(key string) (bool, error)
- func (m MongoTable) IncrementAndUpdateLastTimeout(id string, t int64) error
- func (m MongoTable) IncrementFailed(id string) error
- func (m MongoTable) LogsOlderThen(value int) ([]string, error)
- func (m MongoTable) Update(key string, v any) error
- type Table
- type UserTable
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound error = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type CrashTable ¶
type CrashTable interface { Table // Add the individual crash to the given crash group. // Should be able to parse the crash's error and first line // and add it to the appropriate crash group. // Should also detect if the given individual crash has already been added. AddCrash(c crash.Individual) error }
type MongoTable ¶
type MongoTable struct {
// contains filtered or unexported fields
}
Satisfies both db.Table and db.CrashTable.
func NewMongoTable ¶
func NewMongoTable(c *mongo.Collection) *MongoTable
func (MongoTable) AddCrash ¶
func (m MongoTable) AddCrash(c crash.Individual) error
func (MongoTable) Count ¶ added in v0.3.0
func (m MongoTable) Count(filter map[string]any) (int64, error)
func (MongoTable) Delete ¶
func (m MongoTable) Delete(key string) error
func (MongoTable) IncrementAndUpdateLastTimeout ¶
func (m MongoTable) IncrementAndUpdateLastTimeout(id string, t int64) error
func (MongoTable) IncrementFailed ¶
func (m MongoTable) IncrementFailed(id string) error
func (MongoTable) LogsOlderThen ¶ added in v0.3.0
func (m MongoTable) LogsOlderThen(value int) ([]string, error)
type Table ¶
type Table interface { // Get's the item with the given key then marshals it into v. // If not found, return ErrNotFound Get(key string, v any) error // Attempt to find an item with the given values. // If found, marshall into v. // If query is successful, but can't be found, return ErrNotFound. Find(values map[string]any, v any) (err error) // Similiar to Find, but is expected to return multiple items. // v must be a slice. FindMany(values map[string]any, v any) (err error) // Add a new item to the table. // If the value given does not contain a key value (or _id for mongoDB), then you can get the value's key from the return. Add(v any) (key string, err error) // Update an existing key. This should do a full replacement of values. Update(key string, v any) error // Check if an item with the given key exists. Has(key string) (bool, error) // Check if an item with the given values exists. Contains(values map[string]any) (bool, error) // Delete the given item. Delete(key string) error // Count of documents with the given filter applied Count(filter map[string]any) (int64, error) }
Click to show internal directories.
Click to hide internal directories.