Documentation ¶
Index ¶
- func Batch(c *gin.Context)
- func BatchStatus(c *gin.Context)
- func CreateContainer(c *gin.Context)
- func CreateModel(c *gin.Context)
- func CreateStreaming(c *gin.Context)
- func DeleteRecommendation(c *gin.Context)
- func DeleteStreaming(c *gin.Context)
- func EmptyContainer(c *gin.Context)
- func EmptyModel(c *gin.Context)
- func GetAllContainers(c *gin.Context)
- func GetAllModels(c *gin.Context)
- func GetContainer(c *gin.Context)
- func GetDataPreview(c *gin.Context)
- func GetModel(c *gin.Context)
- func Healthz(c *gin.Context)
- func LinkModel(c *gin.Context)
- func LongVersion(c *gin.Context)
- func ManagementModelRequestStructureValidation(sl validator.StructLevel)
- func ManagementModelRequestValidation(request *ManagementModelRequest) error
- func UpdateStreaming(c *gin.Context)
- func ValidationConcatenationErrorMsg(err error) error
- type BatchBulkResponse
- type BatchRequest
- type BatchResponse
- type BatchStatusResponse
- type BatchStatusResponseError
- type HealthzResponse
- type Internal
- type ManagementContainerRequest
- type ManagementContainerResponse
- type ManagementContainersResponse
- type ManagementDataPreviewResponse
- type ManagementModelRequest
- type ManagementModelResponse
- type ManagementModelsResponse
- type RecommendationRequest
- type StreamingRequest
- type StreamingResponse
- type VersionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchStatus ¶
BatchStatus returns the current status of the batch upload
func CreateContainer ¶
CreateContainer creates a new container for the given publication point and campaign
func CreateModel ¶
CreateModel create a new model in the database where to upload the data
func CreateStreaming ¶
CreateStreaming creates a new record in the selected campaign
func DeleteRecommendation ¶
DeleteRecommendation handles a deletion for a single recommendation item in the list given a signalId and modelName
func DeleteStreaming ¶
DeleteStreaming deletes a single record in the selected campaign
func EmptyContainer ¶
EmptyContainer truncate the container's data
func EmptyModel ¶
EmptyModel truncate the content of a model but leave the model in the database
func GetAllContainers ¶
GetAllContainers returns all the containers in the database
func GetAllModels ¶
GetAllModels returns all the models in the database
func GetContainer ¶
GetContainer returns an already existing container
func GetDataPreview ¶
GetDataPreview returns a preview of the dataset
func LongVersion ¶
LongVersion returns the current version of the APIs
func ManagementModelRequestStructureValidation ¶
func ManagementModelRequestStructureValidation(sl validator.StructLevel)
ManagementModelRequestStructureValidation validates structure and content
func ManagementModelRequestValidation ¶
func ManagementModelRequestValidation(request *ManagementModelRequest) error
ManagementModelRequestValidation validates that there are no errors in the ManagementModelRequest interface
func UpdateStreaming ¶
UpdateStreaming updates a single record in the selected campaign
func ValidationConcatenationErrorMsg ¶
ValidationConcatenationErrorMsg customized error message for the validation
Types ¶
type BatchBulkResponse ¶
type BatchBulkResponse struct {
BatchID string `json:"batchId"`
}
BatchBulkResponse is the object that represents the payload of the response when uploading from S3
type BatchRequest ¶
type BatchRequest struct { ModelName string `json:"modelName" binding:"required"` Data []batch.Data `json:"data" description:"used for uploading some information directly from the request"` DataLocation string `json:"dataLocation" description:"used for specifying where the data lives in S3"` }
BatchRequest is the object that represents the payload of the request for the batch endpoints Conditions: Data takes precedence in case also DataLocation is specified
type BatchResponse ¶
type BatchResponse struct { NumberOfLines string `json:"numberoflines" description:"total count of lines"` ErrorRecords batch.DataUploadedError }
BatchResponse is the object that represents the payload of the response for the batch endpoints
type BatchStatusResponse ¶
type BatchStatusResponse struct { Status string `json:"status"` Errors []models.LineError `json:"errors"` }
BatchStatusResponse is the response payload for getting the status of the bulk upload from S3
type BatchStatusResponseError ¶
type BatchStatusResponseError struct { Status string `json:"status" description:"define the status of the bulk upload when importing data from a file"` NumberOfLinesFailed string `json:"numberoflinesfailed" description:"total count of failed lines"` Line []models.LineError `json:"line" description:"shows the line error and the reason, i.e. {'100', 'reason': 'validation message'}"` }
BatchStatusResponseError is the response paylod when the batch upload failed
type HealthzResponse ¶
type HealthzResponse struct {
Message string `json:"message"`
}
HealthzResponse is the object that represents the response for the healthz endpoint
type Internal ¶
Internal is the struct that will retain the server for ingesting the event from the trackers
func NewInternalAPI ¶
func NewInternalAPI(middlewares ...gin.HandlerFunc) (*Internal, error)
NewInternalAPI creates the o object
func (*Internal) ListenAndServe ¶
ListenAndServe will initialize the server and will listen to the specified port from the config file
type ManagementContainerRequest ¶
type ManagementContainerRequest struct { PublicationPoint string `json:"publicationPoint" binding:"required"` Campaign string `json:"campaign" binding:"required"` Models []string `json:"models"` }
ManagementContainerRequest handles the request from the client
type ManagementContainerResponse ¶
type ManagementContainerResponse struct { Container models.Container `json:"container"` Message string `json:"message"` }
ManagementContainerResponse handles the response object to the client
type ManagementContainersResponse ¶
type ManagementContainersResponse struct { Count int `json:"count"` Containers []models.Container `json:"containers"` Message string `json:"message"` }
ManagementContainersResponse handles the response when there are multiple containers
type ManagementDataPreviewResponse ¶
type ManagementDataPreviewResponse struct { Count int `json:"count"` Preview []models.SingleEntry `json:"preview"` }
ManagementDataPreviewResponse handles the data preview response
type ManagementModelRequest ¶
type ManagementModelRequest struct { Name string `json:"name" description:"name of the model" binding:"required"` SignalOrder []string `json:"signalOrder" description:"list of ordered signals" binding:"required"` Concatenator string `json:"concatenator" description:"character used as concatenator for SignalOrder {'|', '#', '_', '-'}"` }
ManagementModelRequest is the object that represents the payload of the request for the /management/model endpoints
type ManagementModelResponse ¶
type ManagementModelResponse struct { Model models.Model `json:"model" description:"model object that is being returned to the client"` Message string `json:"message" description:"summary of the action just taken"` }
ManagementModelResponse is the object that represents the payload of the response for the /management/model endpoints
type ManagementModelsResponse ¶
type ManagementModelsResponse struct { Count int `json:"count"` Models []models.Model `json:"models"` Message string `json:"message"` }
ManagementModelsResponse handles the response when multiple models
type RecommendationRequest ¶
type RecommendationRequest struct { SignalID string `json:"signalId" binding:"required"` ModelName string `json:"modelName" binding:"required"` Recommendation models.ItemScore `json:"recommendation" binding:"required"` }
RecommendationRequest is the object that represents the payload for the request in the recommendation streaming endpoint
type StreamingRequest ¶
type StreamingRequest struct { SignalID string `json:"signalId" binding:"required"` ModelName string `json:"modelName" binding:"required"` Recommendations []models.ItemScore `json:"recommendations" binding:"required"` }
StreamingRequest is the object that represents the payload for the request in the streaming endpoints
type StreamingResponse ¶
type StreamingResponse struct {
Message string `json:"message"`
}
StreamingResponse is the object that represents the payload for the response in the streaming endpoints
type VersionResponse ¶
type VersionResponse struct {
Version string `json:"version"`
}
VersionResponse is the object that represents the payload of the root endpoint