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, id string) (Advertisement, error)
- func (mongoDb *MongoDb) GetAllVideos(ctx context.Context) ([]Video, error)
- func (mongoDb *MongoDb) GetVideo(ctx context.Context, id string) (Video, error)
- func (mongoDb *MongoDb) GetVideoInference(ctx context.Context, id string) (VideoInference, error)
- func (mongoDb *MongoDb) InitializeVideoInference(ctx context.Context, id string) 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
- func (mongoDb *MongoDb) UpdateVideoInference(ctx context.Context, videoInference VideoInference) error
- type Video
- type VideoInference
Constants ¶
View Source
const ( STATUS_PROCESSING = "PROCESSING" STATUS_COMPLETE = "COMPLETE" STATUS_FAILED = "FAILED" )
View Source
const ( MaxRetryCount = 10 SleepDuration = 10 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:"name,omitempty"`
ImageLink string `bson:"link,omitempty"`
RedirectURL string `bson:"redirectUrl,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
UpdateVideoInference(context.Context, VideoInference) error
GetVideoInference(context.Context, string) (VideoInference, error)
InitializeVideoInference(context.Context, string) error
}
Database Interface
func GetDatabaseClient ¶
func GetDatabaseClient(ctx context.Context, dbConfig config.DatabaseConfiguration) (Database, error)
GetDatabaseClient based on the configuration
type MongoDb ¶ added in v0.2.1
MongoDb struct
func GetMongoDb ¶ added in v0.2.1
GetMongoDb client connection to the database
func (*MongoDb) FindAdsWithObjects ¶ added in v0.2.1
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 ¶ added in v0.2.1
GetAllVideos from the collection
func (*MongoDb) GetVideoInference ¶ added in v0.2.1
GetVideoInference from the collection
func (*MongoDb) InitializeVideoInference ¶ added in v0.2.1
func (*MongoDb) InsertAd ¶ added in v0.2.1
func (mongoDb *MongoDb) InsertAd(ctx context.Context, ad Advertisement) error
InsertAd into the collection
func (*MongoDb) InsertVideo ¶ added in v0.2.1
InsertVideo into the collection
func (*MongoDb) InsertVideoInference ¶ added in v0.2.1
func (mongoDb *MongoDb) InsertVideoInference(ctx context.Context, videoInference VideoInference) error
InsertVideoInference into the collection
func (*MongoDb) UpdateVideoInference ¶ added in v0.2.1
func (mongoDb *MongoDb) UpdateVideoInference(ctx context.Context, videoInference VideoInference) error
UpdateVideoInference into the collection
type Video ¶
type Video struct {
Name string `bson:"name,omitempty"`
Description string `bson:"desc,omitempty"`
StorageLink string `bson:"link,omitempty"`
}
Video Struct
type VideoInference ¶
type VideoInference struct {
Id string `bson:"_id,omitempty"` // Video Identifier
Status string `bson:"status,omitempty"` // Video Inference processing status -> PROCESSING, COMPLETE, FAILED
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.