internal

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Batch

func Batch(c *gin.Context)

Batch will upload in batch a set to the database

func BatchStatus

func BatchStatus(c *gin.Context)

BatchStatus returns the current status of the batch upload

func CreateContainer

func CreateContainer(c *gin.Context)

CreateContainer creates a new container for the given publication point and campaign

func CreateModel

func CreateModel(c *gin.Context)

CreateModel create a new model in the database where to upload the data

func CreateStreaming

func CreateStreaming(c *gin.Context)

CreateStreaming creates a new record in the selected campaign

func DeleteRecommendation

func DeleteRecommendation(c *gin.Context)

DeleteRecommendation handles a deletion for a single recommendation item in the list given a signalId and modelName

func DeleteStreaming

func DeleteStreaming(c *gin.Context)

DeleteStreaming deletes a single record in the selected campaign

func EmptyContainer

func EmptyContainer(c *gin.Context)

EmptyContainer truncate the container's data

func EmptyModel

func EmptyModel(c *gin.Context)

EmptyModel truncate the content of a model but leave the model in the database

func GetAllContainers

func GetAllContainers(c *gin.Context)

GetAllContainers returns all the containers in the database

func GetAllModels

func GetAllModels(c *gin.Context)

GetAllModels returns all the models in the database

func GetContainer

func GetContainer(c *gin.Context)

GetContainer returns an already existing container

func GetDataPreview

func GetDataPreview(c *gin.Context)

GetDataPreview returns a preview of the dataset

func GetModel

func GetModel(c *gin.Context)

GetModel returns the model's information from the given parameters in input

func Healthz

func Healthz(c *gin.Context)

Healthz will ping the api to make sure that it's alive

func LinkModel

func LinkModel(c *gin.Context)

LinkModel attaches the specified models in input to an existing container

func LongVersion

func LongVersion(c *gin.Context)

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

func UpdateStreaming(c *gin.Context)

UpdateStreaming updates a single record in the selected campaign

func ValidationConcatenationErrorMsg

func ValidationConcatenationErrorMsg(err error) error

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

type Internal struct {
	App *gin.Engine
}

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

func (i *Internal) ListenAndServe(host string) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL