Documentation
¶
Index ¶
Constants ¶
View Source
const ( NOTIFICATION_STATUS_ACTIVE = 1 NOTIFICATION_STATUS_SCHEDULED = 2 NOTIFICATION_STATUS_CANCELED = 3 NOTIFICATION_STATUS_FINISHED = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthToken ¶
func (*AuthToken) MarshalJSON ¶
type Notification ¶
type Notification struct {
ID int `json:"id"`
PID string `json:"pid"`
Status int `json:"status"`
Title string `json:"title"`
Text string `json:"text"`
BigText *string `json:"big-text,omitempty"`
Image *string `json:"image,omitempty"`
BigImage *string `json:"big-image,omitempty"`
Priority string `json:"priority"`
Style string `json:"style"`
Action *string `json:"action,omitempty"`
Extra *string `json:"extra,omitempty"`
ViewsCount int `json:"views"`
ClicksCount int `json:"clicks"`
CreateTime *time.Time `json:"create_time"`
ActiveTime *time.Time `json:"active_time"`
ExpireTime *time.Time `json:"expire_time"`
ScheduleTime *time.Time `json:"schedule_time"`
ClickReport bool `json:"click_report"`
}
type NotificationCache ¶
type NotificationCache interface {
LoadScripts(ctx context.Context) error
GetTimeByProjectID(ctx context.Context, pid string) (*time.Time, error)
GetDataExistsByProjectID(ctx context.Context, pid string) (bool, error)
GetDataByProjectID(ctx context.Context, pid string) (*string, error)
GetViewsByProjectID(ctx context.Context, pid string) (string, error)
UpdateProjectData(ctx context.Context, pid string, ids string, data string, t time.Time, expire time.Duration) error
DeleteProjectData(ctx context.Context, pid string) error
SetProjectDataExpire(ctx context.Context, pid string, expiration time.Duration) error
GetClicksByProjectID(ctx context.Context, pid string) (map[string]string, error)
IncrClicks(ctx context.Context, pid string, id string) error
IncrClicksIds(ctx context.Context, pid string, ids []string) error
}
type NotificationRepository ¶
type NotificationRepository interface {
GetByID(ctx context.Context, id int) (*Notification, error)
GetByPID(ctx context.Context, pid string, limit int, offset int) ([]Notification, error)
Insert(ctx context.Context, n *Notification) error
Update(ctx context.Context, n *Notification) error
Delete(ctx context.Context, n *Notification) error
}
type ProjectRepository ¶
type ProjectRepository interface {
GetByID(ctx context.Context, id string) (*Project, error)
GetProjectsByUserID(ctx context.Context, uid int) ([]Project, error)
Insert(ctx context.Context, project *Project) error
Update(ctx context.Context, project *Project) error
Delete(ctx context.Context, project *Project) error
}
type RemoteConfig ¶
func (*RemoteConfig) MarshalJSON ¶
func (r *RemoteConfig) MarshalJSON() ([]byte, error)
type RemoteConfigCache ¶
type RemoteConfigCache interface {
LoadScripts(ctx context.Context) error
GetDataExistsByProjectID(ctx context.Context, pid string) (bool, error)
GetDataByProjectID(ctx context.Context, pid string) (*string, error)
GetVersionByProjectID(ctx context.Context, pid string) (*int, error)
Update(ctx context.Context, rc *RemoteConfig) error
}
type RemoteConfigRepository ¶
type RemoteConfigRepository interface {
GetByProjectID(ctx context.Context, pid string) (*RemoteConfig, error)
Insert(ctx context.Context, rc *RemoteConfig) error
Update(ctx context.Context, rc *RemoteConfig) error
}
Click to show internal directories.
Click to hide internal directories.