Documentation ¶
Index ¶
- Constants
- type Analytics
- type EventLog
- type EventLogService
- type Person
- type PersonService
- type PrivacyLevel
- type Subscription
- type SubscriptionService
- func (service *SubscriptionService) Find(exp goqu.Ex) ([]Subscription, error)
- func (service *SubscriptionService) Get(exp goqu.Ex) (*Subscription, error)
- func (service *SubscriptionService) Insert(sub Subscription) (int64, error)
- func (service *SubscriptionService) Update(set interface{}, where goqu.Expression) error
- type Tier
- type TierService
Constants ¶
View Source
const ( TABLE_SUBSCRIPTIONS = `subscriptions` STATE_UNKNOWN = 0 STATE_ACTIVE = 1 STATE_TIER_CHANGED = 2 STATE_CANCELLED = 3 )
View Source
const (
TABLE_EVENTS_LOGS = `events_logs`
)
View Source
const (
TABLE_PERSONS = `persons`
)
View Source
const (
TABLE_TIERS = `tiers`
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analytics ¶
type Analytics struct {
// contains filtered or unexported fields
}
func New ¶
func New( db *database.Database, personService *PersonService, eventLogService *EventLogService, tierService *TierService, subscriptionService *SubscriptionService, ) *Analytics
func (*Analytics) Process ¶
func (analytics *Analytics) Process(event *webhooks.Sponsorship)
type EventLog ¶
type EventLog struct { ID int64 `db:"id" json:"id"` DeliveryID string `db:"delivery_id" json:"delivery_id"` ReceiverID int64 `db:"receiver_id" json:"receiver_id"` SponsorID int64 `db:"sponsor_id" json:"sponsor_id"` Action string `db:"action" json:"action"` PrivacyLevel uint8 `db:"privacy_level" json:"privacy_level"` SponsorshipNodeID string `db:"sponsorship_node_id" json:"sponsorship_node_id"` TierID int64 `db:"tier_id" json:"tier_id"` TierPrice int `db:"tier_price" json:"tier_price"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
type EventLogService ¶
type EventLogService struct {
// contains filtered or unexported fields
}
func NewEventLogService ¶
func NewEventLogService(db *database.Database) *EventLogService
type Person ¶
type Person struct { ID int64 `db:"id" json:"id"` RemoteNodeID string `db:"remote_node_id" json:"remote_node_id"` RemoteID int `db:"remote_id" json:"remote_id"` Login string `db:"login" json:"login"` AvatarURL string `db:"avatar_url" json:"avatar_url"` CreatedAt time.Time `db:"created_at" goqu:"skipupdate" json:"created_at"` }
type PersonService ¶
type PersonService struct {
// contains filtered or unexported fields
}
func NewPersonService ¶
func NewPersonService(db *database.Database) *PersonService
type PrivacyLevel ¶
type PrivacyLevel uint8
const ( PrivacyLevelUnknown PrivacyLevel = 0 PrivacyLevelPublic PrivacyLevel = 1 PrivacyLevelPrivate PrivacyLevel = 2 )
func GetPrivacyLevel ¶
func GetPrivacyLevel(str string) PrivacyLevel
func (PrivacyLevel) String ¶
func (level PrivacyLevel) String() string
type Subscription ¶
type Subscription struct { ID int64 `db:"id" json:"id"` State uint8 `db:"state" json:"state"` SponsorshipNodeID string `db:"sponsorship_node_id" json:"sponsorship_node_id"` RemoteCreatedAt time.Time `db:"remote_created_at" json:"remote_created_at"` ReceiverID int64 `db:"receiver_id" json:"receiver_id"` SponsorID int64 `db:"sponsor_id" json:"sponsor_id"` TierID int64 `db:"tier_id" json:"tier_id"` TierName string `db:"tier_name" json:"tier_name"` TierPrice int `db:"tier_price" json:"tier_price"` CreatedAt time.Time `db:"created_at" json:"created_at"` CancelledAt *time.Time `db:"cancelled_at" goqu:"skipinsert" json:"cancelled_at,omitempty"` }
type SubscriptionService ¶
type SubscriptionService struct {
// contains filtered or unexported fields
}
func NewSubscriptionService ¶
func NewSubscriptionService(db *database.Database) *SubscriptionService
func (*SubscriptionService) Find ¶
func (service *SubscriptionService) Find(exp goqu.Ex) ([]Subscription, error)
func (*SubscriptionService) Get ¶
func (service *SubscriptionService) Get(exp goqu.Ex) (*Subscription, error)
func (*SubscriptionService) Insert ¶
func (service *SubscriptionService) Insert(sub Subscription) (int64, error)
func (*SubscriptionService) Update ¶
func (service *SubscriptionService) Update( set interface{}, where goqu.Expression, ) error
type Tier ¶
type Tier struct { ID int64 `db:"id" json:"id"` RemoteNodeID string `db:"remote_node_id" json:"remote_node_id"` ReceiverID int64 `db:"receiver_id" json:"receiver_id"` Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` Price int `db:"price" json:"price"` RemoteCreatedAt time.Time `db:"remote_created_at" json:"remote_created_at"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt *time.Time `db:"updated_at" goqu:"skipinsert" json:"updated_at,omitempty"` }
type TierService ¶
type TierService struct {
// contains filtered or unexported fields
}
func NewTierService ¶
func NewTierService(db *database.Database) *TierService
Click to show internal directories.
Click to hide internal directories.