Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerExists ¶
ContainerExists checks if the container is actually in the database
func ContainerUniqueName ¶
ContainerUniqueName returns the unique name for the container
Types ¶
type Container ¶
type Container struct { PublicationPoint string `json:"publicationPoint" description:"publication point where the model will be connected to"` Campaign string `json:"campaign" description:"name for where in a potential place of the internal products, the model will be placed"` Models []string `json:"models,omitempty" description:"list of models that are linked to this container"` }
Container is used simply as reference to understand where the models are connected to Models and Containers are separate entities that have a "fake" relationship
func DeserializeContainer ¶
DeserializeContainer attempts to convert the string in input in a container object
func GetAllContainers ¶
GetAllContainers returns all the containers in the database
func GetContainer ¶
GetContainer checks if an existing object already exists or not
func NewContainer ¶
NewContainer creates a new container in the database
func (*Container) DeleteContainer ¶
DeleteContainer deletes the content of the container by truncating the PublicationPoint (aka setName)
type ItemScore ¶
ItemScore is the object containing the recommended item and its score Example: {"item":"11","score":"0.6","type":"movie"}
func DeserializeItemScoreArray ¶
DeserializeItemScoreArray attempts to convert a string into an array of ItemScore
type LineError ¶
LineError contains the line number as key and the error message as string Example: {"1":"error signal format",2:"error bananas too small"}
func DeserializeLineErrorArray ¶
DeserializeLineErrorArray attempts to convert a string into an array of LineError
type Model ¶
type Model struct { Name string `json:"name" description:"name of the model that will be used"` SignalOrder []string `json:"signalOrder" description:"list of ordered signals"` Concatenator string `json:"concatenator" description:"character used as concatenator for SignalOrder {'|','#','_','-'}"` }
Model is the object that acts as container for the metadata of each model
func DeserializeModel ¶
DeserializeModel takes a JSON string in input and try to convert it to a Model object
func GetAllModels ¶
GetAllModels is a convenient functions to get all the models from DB
func (*Model) CorrectSignalFormat ¶
CorrectSignalFormat checks that the signal format is correct
func (*Model) DeleteModel ¶
DeleteModel truncate all the data belonging to a model
func (*Model) GetDataPreview ¶
GetDataPreview returns a limited amount of data as preview for a single model
func (*Model) RequireSignalFormat ¶
RequireSignalFormat checks if it is required to check the signal format
type RecordQueue ¶
type RecordQueue struct { Table string Entry SingleEntry Error *LineError }
RecordQueue is the object used to upload the data when coming from S3 with channels
type SingleEntry ¶
type SingleEntry struct { SignalID string `json:"signalId"` Recommended []ItemScore `json:"recommended"` }
SingleEntry is the object used to unmarshal a single JSON line
func DeserializeSingleEntryArray ¶
func DeserializeSingleEntryArray(preview map[string]string) ([]SingleEntry, error)
DeserializeSingleEntryArray returns an array of single entries object based on the data preview