Documentation
¶
Index ¶
- func EnsureIndexes(ctx context.Context, db *mongo.Database) error
- func GetDatabase() *mongo.Database
- func NewClient(collection string) (c *mongo.Collection)
- type CatalogStoreClient
- func (c *CatalogStoreClient) Delete(ctx context.Context, filter map[string]interface{}) (err error)
- func (c *CatalogStoreClient) Get(ctx context.Context, filter map[string]interface{}) (result *v1alpha1.Catalog, err error)
- func (c *CatalogStoreClient) List(ctx context.Context) (results []*v1alpha1.Catalog, err error)
- func (c *CatalogStoreClient) Update(ctx context.Context, filter map[string]interface{}, ...) (result *v1alpha1.Catalog, err error)
- type EventStoreClient
- func (c *EventStoreClient) AggregateByMonth(ctx context.Context, matchFilter bson.D, groupByService bool) ([]MonthlyStatsResult, error)
- func (c *EventStoreClient) CountWithFilter(ctx context.Context, filter bson.D) (int64, error)
- func (c *EventStoreClient) Create(ctx context.Context, eventInsert *v1alpha1.Event) (result *v1alpha1.Event, err error)
- func (c *EventStoreClient) Delete(ctx context.Context, filter map[string]interface{}) (err error)
- func (c *EventStoreClient) Get(ctx context.Context, filter map[string]interface{}) (result *v1alpha1.Event, err error)
- func (c *EventStoreClient) List(ctx context.Context) (results []*v1alpha1.Event, err error)
- func (c *EventStoreClient) Search(ctx context.Context, filter map[string]interface{}) (results []*v1alpha1.Event, err error)
- func (c *EventStoreClient) Update(ctx context.Context, filter map[string]interface{}, ...) (result *v1alpha1.Event, err error)
- type LinkItem
- type LinksStoreClient
- func (c *LinksStoreClient) Create(ctx context.Context, item *LinkItem) (*LinkItem, error)
- func (c *LinksStoreClient) Delete(ctx context.Context, id string) error
- func (c *LinksStoreClient) List(ctx context.Context) ([]*LinkItem, error)
- func (c *LinksStoreClient) Update(ctx context.Context, id string, item *LinkItem) (*LinkItem, error)
- type LockStoreClient
- func (c *LockStoreClient) Create(ctx context.Context, lockInsert *v1alpha1.Lock) (result *v1alpha1.Lock, err error)
- func (c *LockStoreClient) Get(ctx context.Context, filter map[string]interface{}) (result *v1alpha1.Lock, err error)
- func (c *LockStoreClient) List(ctx context.Context) (results []*v1alpha1.Lock, err error)
- func (c *LockStoreClient) Unlock(ctx context.Context, filter map[string]interface{}) (count int64, err error)
- func (c *LockStoreClient) Update(ctx context.Context, filter map[string]interface{}, lockUpdate *v1alpha1.Lock) (result *v1alpha1.Lock, err error)
- type MongoClient
- type MonthlyStatsResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureIndexes ¶ added in v0.9.0
EnsureIndexes crée les index nécessaires pour optimiser les requêtes MongoDB Cette fonction doit être appelée au démarrage de l'application
func GetDatabase ¶ added in v0.9.0
GetDatabase retourne l'instance de la base de données MongoDB Utilisé pour l'initialisation des index
func NewClient ¶
func NewClient(collection string) (c *mongo.Collection)
Types ¶
type CatalogStoreClient ¶ added in v0.4.0
type CatalogStoreClient struct {
// contains filtered or unexported fields
}
func NewStoreCatalog ¶ added in v0.4.0
func NewStoreCatalog(collection string) (c *CatalogStoreClient)
func (*CatalogStoreClient) Delete ¶ added in v0.4.0
func (c *CatalogStoreClient) Delete(ctx context.Context, filter map[string]interface{}) (err error)
func (*CatalogStoreClient) Get ¶ added in v0.4.0
func (c *CatalogStoreClient) Get(ctx context.Context, filter map[string]interface{}) (result *v1alpha1.Catalog, err error)
Get an Catalog and creates it. Returns the server's representation of the Catalog, and an error, if there is any.
type EventStoreClient ¶
type EventStoreClient struct {
// contains filtered or unexported fields
}
func NewStoreEvent ¶
func NewStoreEvent(collection string) (c *EventStoreClient)
func (*EventStoreClient) AggregateByMonth ¶ added in v0.15.0
func (c *EventStoreClient) AggregateByMonth(ctx context.Context, matchFilter bson.D, groupByService bool) ([]MonthlyStatsResult, error)
AggregateByMonth aggregates events by month with optional service grouping
func (*EventStoreClient) CountWithFilter ¶ added in v0.15.0
CountWithFilter counts events matching the given filter
func (*EventStoreClient) Create ¶
func (c *EventStoreClient) Create(ctx context.Context, eventInsert *v1alpha1.Event) (result *v1alpha1.Event, err error)
Create takes the representation of an Event and creates it. Returns the server's representation of the Event, and an error, if there is any.
func (*EventStoreClient) Delete ¶ added in v0.3.0
func (c *EventStoreClient) Delete(ctx context.Context, filter map[string]interface{}) (err error)
func (*EventStoreClient) Get ¶
func (c *EventStoreClient) Get(ctx context.Context, filter map[string]interface{}) (result *v1alpha1.Event, err error)
Get an Event and creates it. Returns the server's representation of the Event, and an error, if there is any.
func (*EventStoreClient) List ¶
List takes label and field selectors, and returns the list of Events that match those selectors.
type LinkItem ¶ added in v0.17.0
type LinkItem struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Group string `bson:"group" json:"group"`
Name string `bson:"name" json:"name"`
URL string `bson:"url" json:"url"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
Icon string `bson:"icon,omitempty" json:"icon,omitempty"`
Color string `bson:"color,omitempty" json:"color,omitempty"`
Logo string `bson:"logo,omitempty" json:"logo,omitempty"`
CreatedAt int64 `bson:"created_at" json:"created_at"`
UpdatedAt int64 `bson:"updated_at" json:"updated_at"`
}
LinkItem represents a single link stored in MongoDB
type LinksStoreClient ¶ added in v0.17.0
type LinksStoreClient struct {
// contains filtered or unexported fields
}
func NewStoreLinks ¶ added in v0.17.0
func NewStoreLinks(collection string) *LinksStoreClient
func (*LinksStoreClient) Delete ¶ added in v0.17.0
func (c *LinksStoreClient) Delete(ctx context.Context, id string) error
type LockStoreClient ¶
type LockStoreClient struct {
// contains filtered or unexported fields
}
func NewStoreLock ¶
func NewStoreLock(collection string) (c *LockStoreClient)
func (*LockStoreClient) Create ¶
func (c *LockStoreClient) Create(ctx context.Context, lockInsert *v1alpha1.Lock) (result *v1alpha1.Lock, err error)
Create takes the representation of an Lock and creates it. Returns the server's representation of the Lock, and an error, if there is any.
func (*LockStoreClient) Get ¶
func (c *LockStoreClient) Get(ctx context.Context, filter map[string]interface{}) (result *v1alpha1.Lock, err error)
Get an Lock and creates it. Returns the server's representation of the Lock, and an error, if there is any.
func (*LockStoreClient) List ¶
List takes label and field selectors, and returns the list of Locks that match those selectors.
type MongoClient ¶
type MongoClient struct {
// contains filtered or unexported fields
}
MongoClient is used to interact with features