Documentation
¶
Index ¶
- func CreateCampaign(name, poolAddress string, startTime, endTime int64) (int, error)
- func CreateOnboardingTask(campaignID int, description string, onboardingReward float64, ...) (int, error)
- func CreateSharePoolTask(campaignID int, description string, pointsPool float64, ...) (int, error)
- func CreateTask(campaignID int, taskType, description string, onboardingReward float64, ...) (int, error)
- func CreateUser(address string) (int, error)
- func CreateUserPointsHistory(userID, taskID, campaignID int, points float64) error
- func CreateUserTask(userID, taskID int, completed bool, amount, points float64) (int, error)
- func GetActiveCampaignAddresses() ([]string, error)
- func GetOrCreateUserID(address string) (int, error)
- func IncreaseUserTaskAmount(taskID int, userID int, amount float64) error
- func InitPostgreSQL() *sql.DB
- func InsertSwapEvent(userID int, poolAddress string, usdc float64, swapTime int64, txHash string) error
- func UpdateUserTask(userTaskID int, completed bool, amount, points float64) error
- func UpdateUserTaskByUserIDTaskID(userID, taskID int, completed bool, amount, points float64) error
- type Campaign
- type DBConfig
- type Task
- func GetActiveTasksByCampaignID(campaignID int, timestamp int64) ([]Task, error)
- func GetExpiredSharePoolTasks(now int64, lastCheckTime int64) ([]Task, error)
- func GetOnboardingTaskByCampaignID(campaignID int) (*Task, error)
- func GetTasksByCampaignID(campaignID int) ([]Task, error)
- func GetTasksByTaskIDs(taskIDs []int) ([]Task, error)
- type User
- type UserPointsHistory
- type UserSwap
- type UserTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCampaign ¶
func CreateOnboardingTask ¶
func CreateSharePoolTask ¶
func CreateTask ¶
func CreateUser ¶
func CreateUserPointsHistory ¶
func CreateUserTask ¶
func GetOrCreateUserID ¶
func IncreaseUserTaskAmount ¶
func InitPostgreSQL ¶
func InsertSwapEvent ¶
func UpdateUserTask ¶
Types ¶
type Campaign ¶
type Campaign struct { CampaignID int Name string PoolAddress string StartTime int64 EndTime int64 CreatedAt int64 UpdatedAt int64 }
func GetCampaignByID ¶
func GetCampaignsByAddress ¶
type Task ¶
type Task struct { TaskID int CampaignID int Type string Description string OnboardingReward float64 OnboardingThreshold float64 PointsPool float64 StartTime int64 EndTime int64 CreatedAt int64 UpdatedAt int64 }
func GetTasksByCampaignID ¶
func GetTasksByTaskIDs ¶
type UserPointsHistory ¶
type UserPointsHistory struct { HistoryID int UserID int TaskID int CampaignID int Points float64 CreatedAt int64 }
func GetUserPointsHistoryByUserID ¶
func GetUserPointsHistoryByUserID(userID int) ([]UserPointsHistory, error)
Click to show internal directories.
Click to hide internal directories.