Documentation ¶
Index ¶
Constants ¶
View Source
const (
// TableName is the table used to store the data
TableName = "trinacia"
)
Variables ¶
View Source
var ( // ErrorMissingUserID missing user id ErrorMissingUserID = errors.New("Missing User ID") // ErrorMissingPlatform missing platform ErrorMissingPlatform = errors.New("Missing Platform") // ErrorMissingAdAccount missing ad account ErrorMissingAdAccount = errors.New("Missing ad account") // ErrorMissingSegment missing segment ErrorMissingSegment = errors.New("Missing segment") // ErrorInvalidCampaign one or more fields is missing to create a campaign ErrorInvalidCampaign = errors.New("Missing some of the required campaign fields") // ErrorMissingCampaignID missing campaign id ErrorMissingCampaignID = errors.New("Missing campaign id") // ErrorUnableToFindCampaign get campaign found no result ErrorUnableToFindCampaign = errors.New("Unable to find the campaign") )
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage interface { // Campaign storage StoreCampaign(userID, platform, adAccount, segment string, c *entities.Campaign) error GetCampaign(campaignID string) (*entities.Campaign, error) GetUserCampaigns(userID string) (map[string][]string, error) // GetActiveCampaigns returns a maping from userID to active campaigns' ID GetActiveCampaigns(platform string) (map[string][]string, error) // Segment Storage // SetSegment initialices a segment to the provided initial targeting population SetSegment(userID, segment string, initialPopulation []*genetic.Chromosome) error // GetSegment returns initial targeting population of the segment GetSegment(userID, segment string) ([]*genetic.Chromosome, error) // GetSegments returns the names of user defined segments GetSegments(userID string) ([]string, error) // GetSegmentCampaigns returns all campaigns created by a // user initialized segment sorted in decesing order by end time GetSegmentCampaigns(userID, segment string) ([]string, error) }
Storage interface to get campaign information from database
Click to show internal directories.
Click to hide internal directories.