Documentation
¶
Index ¶
- Constants
- type Advertisement
- type Database
- type Interval
- type MongoDB
- func (mongoDB *MongoDB) FindAdsWithObjects(ctx context.Context, objects []string) ([]Advertisement, error)
- func (mongoDB *MongoDB) GetAd(ctx context.Context, name string) (Advertisement, error)
- func (mongoDB *MongoDB) GetAllVideos(ctx context.Context) ([]Video, error)
- func (mongoDB *MongoDB) GetVideo(ctx context.Context, name string) (Video, error)
- func (mongoDB *MongoDB) GetVideoInference(ctx context.Context, name string) (VideoInference, error)
- func (mongoDB *MongoDB) InsertAd(ctx context.Context, ad Advertisement) error
- func (mongoDB *MongoDB) InsertVideo(ctx context.Context, video Video) error
- func (mongoDB *MongoDB) InsertVideoInference(ctx context.Context, videoInference VideoInference) error
- type Video
- type VideoInference
Constants ¶
View Source
const ( VideoCollection = "Videos" AdCollection = "Advertisements" VideoInferenceCollection = "VideoInference" )
constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advertisement ¶
type Advertisement struct {
Name string `bson:"_id,omitempty"`
ImageLink string `bson:"link,omitempty"`
Object string `bson:"object,omitempty"`
}
Advertisement Struct
type Database ¶
type Database interface {
InsertVideo(context.Context, Video) error
GetVideo(context.Context, string) (Video, error)
GetAllVideos(context.Context) ([]Video, error)
InsertAd(context.Context, Advertisement) error
GetAd(context.Context, string) (Advertisement, error)
FindAdsWithObjects(context.Context, []string) ([]Advertisement, error)
InsertVideoInference(context.Context, VideoInference) error
GetVideoInference(context.Context, string) (VideoInference, error)
}
Database Interface
func GetDatabaseClient ¶
func GetDatabaseClient(ctx context.Context, dbConfig config.DatabaseConfiguration) (Database, error)
GetDatabaseClient based on the configuration
type MongoDB ¶
MongoDB struct
func GetMongoDB ¶
GetMongoDB client connection to the database
func (*MongoDB) FindAdsWithObjects ¶
func (mongoDB *MongoDB) FindAdsWithObjects(ctx context.Context, objects []string) ([]Advertisement, error)
FindAdsWithObjects find all ads that have objects in the given object list
func (*MongoDB) GetAllVideos ¶
GetAllVideos from the collection
func (*MongoDB) GetVideoInference ¶
GetVideoInference from the collection
func (*MongoDB) InsertAd ¶
func (mongoDB *MongoDB) InsertAd(ctx context.Context, ad Advertisement) error
InsertAd into the collection
func (*MongoDB) InsertVideo ¶
InsertVideo into the collection
func (*MongoDB) InsertVideoInference ¶
func (mongoDB *MongoDB) InsertVideoInference(ctx context.Context, videoInference VideoInference) error
InsertVideoInference into the collection
type Video ¶
type Video struct {
Name string `bson:"_id,omitempty"` // name unique
Description string `bson:"desc,omitempty"`
StorageLink string `bson:"link,omitempty"`
}
Video Struct
type VideoInference ¶
type VideoInference struct {
Name string `bson:"_id,omitempty"` // video name
ObjectCountsEachSecond string
ObjectsToAvgFrequency map[string]float32
TopFiveObjectsToInterval map[string]Interval
TopFiveObjectsToAvgFrequency map[string]float32 `bson:"timeToObject,omitempty"`
}
VideoInference Struct
Click to show internal directories.
Click to hide internal directories.