Documentation
¶
Index ¶
- func DeleteCarrier(db orm.DB, carrier *Carrier) error
- func DeleteCarrierHashtag(db orm.DB, CarrierHashtag *CarrierHashtag) error
- func DeleteCarrierPlan(db orm.DB, CarrierPlan *CarrierPlan) error
- func DeleteReport(db orm.DB, Report *Report) error
- func DeleteRequest(db orm.DB, Request *Request) error
- func InsertCarrier(db orm.DB, carrier *Carrier) error
- func InsertCarrierHashtag(db orm.DB, CarrierHashtag *CarrierHashtag) error
- func InsertCarrierPlan(db orm.DB, CarrierPlan *CarrierPlan) error
- func InsertPublishable(db orm.DB, publishable *Publishable) error
- func InsertReport(db orm.DB, Report *Report) error
- func InsertRequest(db orm.DB, Request *Request) error
- func RandomId(len int) string
- func SaveCarrier(db orm.DB, carrier *Carrier) error
- func SaveCarrierHashtag(db orm.DB, CarrierHashtag *CarrierHashtag) error
- func SaveCarrierPlan(db orm.DB, CarrierPlan *CarrierPlan) error
- func SavePublishable(db orm.DB, publishable *Publishable) error
- func SaveReport(db orm.DB, Report *Report) error
- func SaveRequest(db orm.DB, Request *Request) error
- type ArchivedPublishable
- type Carrier
- type CarrierFacebookInfo
- type CarrierForm
- type CarrierHashtag
- type CarrierOptions
- type CarrierPlan
- type CarrierPosting
- type PaymentType
- type Publishable
- type PublishableError
- type PublishableSource
- type PublishableStatus
- type Report
- type ReportReason
- type ReportStatus
- type Request
- type RequestStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCarrierHashtag ¶
func DeleteCarrierHashtag(db orm.DB, CarrierHashtag *CarrierHashtag) error
func DeleteCarrierPlan ¶
func DeleteCarrierPlan(db orm.DB, CarrierPlan *CarrierPlan) error
func InsertCarrierHashtag ¶
func InsertCarrierHashtag(db orm.DB, CarrierHashtag *CarrierHashtag) error
func InsertCarrierPlan ¶
func InsertCarrierPlan(db orm.DB, CarrierPlan *CarrierPlan) error
func InsertPublishable ¶
func InsertPublishable(db orm.DB, publishable *Publishable) error
func SaveCarrierHashtag ¶
func SaveCarrierHashtag(db orm.DB, CarrierHashtag *CarrierHashtag) error
func SaveCarrierPlan ¶
func SaveCarrierPlan(db orm.DB, CarrierPlan *CarrierPlan) error
func SavePublishable ¶
func SavePublishable(db orm.DB, publishable *Publishable) error
Types ¶
type ArchivedPublishable ¶
type ArchivedPublishable struct {
Publishable
ArchivedAt time.Time
}
func ArchivePublishable ¶
func ArchivePublishable(db *pg.DB, p *Publishable) (*ArchivedPublishable, error)
type Carrier ¶
type Carrier struct {
Id string `sql:",pk"`
Name string
Suspended bool `json:"suspended"`
FacebookPage string `json:"facebook_page"`
FacebookInfo *CarrierFacebookInfo `json:"facebook_info"`
Form *CarrierForm `json:"form"`
Posting *CarrierPosting `json:"posting"`
Statistics map[string]interface{} `json:"statistics"`
}
func (*Carrier) NextHashtag ¶
type CarrierFacebookInfo ¶
type CarrierForm ¶
type CarrierForm struct {
Enabled bool `json:"enabled"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
Terms string `json:"terms"`
SecretPrompt string `json:"secret_prompt"`
ImagePrompt string `json:"image_prompt"`
SentMessage string `json:"sent_message"`
BackgroundUrl string `json:"background_url"`
Dark bool `json:"dark"`
AcceptsImage bool `json:"accepts_image"`
CustomCss string `json:"custom_css"`
OptionSets map[string]CarrierOptions `json:"option_sets"`
}
type CarrierHashtag ¶
type CarrierHashtag struct {
Carrier string `json:"carrier"`
Hashtag string `json:"hashtag" sql:",pk"`
MinNumber int `json:"min_number"`
}
func FindCarrierHashtag ¶
func FindCarrierHashtag(db orm.DB, carrier, hashtag string) (*CarrierHashtag, error)
type CarrierOptions ¶
type CarrierPlan ¶
type CarrierPlan struct {
Id string `json:"id"`
Carrier string `json:"carrier"`
Type PaymentType `json:"type"`
ExpiresAt time.Time `json:"expires_at"`
QuotaReset time.Time `json:"quota_reset"`
QuotaTotal int `json:"quota_total"`
QuotaAvailable int `json:"quota_available"`
}
func FindCarrierPlan ¶
func FindCarrierPlan(db orm.DB, id string) (*CarrierPlan, error)
func FindCarrierPlanByCarrier ¶
func FindCarrierPlanByCarrier(db orm.DB, carrier string) (*CarrierPlan, error)
type CarrierPosting ¶
type Publishable ¶
type Publishable struct {
Carrier string `json:"carrier"`
Id string `json:"id" sql:",pk"`
//Who created the post
Source int `json:"source" sql:",notnull"`
//The parent post ID
Parent string `json:"parent"`
//Disables custom formatting
DisableFormat bool `json:"disable_format"`
Status PublishableStatus `json:"status" sql:",notnull"`
StatusDescription string `json:"status_description,omitempty"`
//Source data
PublishableSource
QueuedTime time.Time `json:"queued_time,omitempty"`
PublishTime time.Time `json:"publish_time,omitempty"`
Publisher string `json:"publisher,omitempty"`
PublishTag string `json:"publish_tag,omitempty"`
//Facebook post details
FacebookPost string `json:"facebook_post,omitempty"`
ChecksData []PublishableSource `json:"checks_data,omitempty"`
Content string `json:"content"`
OriginalContent string `json:"original_content"`
ImageId string `json:"image_id,omitempty"`
Options map[string]string `json:"options,omitempty"`
Statistics map[string]interface{} `json:"statistics,omitempty"`
FinalForm string `json:"final_form" sql:"-"`
Properties string `json:"properties" sql:"-"`
}
func FindPublishable ¶
func FindPublishable(db orm.DB, id string) (*Publishable, error)
func FindPublishableByHashtag ¶
func FindPublishableByHashtag(db orm.DB, hashtag string) (*Publishable, error)
func (*Publishable) BuildFormats ¶
func (p *Publishable) BuildFormats(c *Carrier, similar int)
func (*Publishable) IsChild ¶
func (p *Publishable) IsChild() bool
func (*Publishable) NoFormat ¶
func (p *Publishable) NoFormat(carrier *Carrier) bool
type PublishableError ¶
type PublishableError int
const (
PublishableErrorNoQuota PublishableError = iota
)
func (PublishableError) Error ¶
func (p PublishableError) Error() string
type PublishableSource ¶
type PublishableSource struct {
Timestamp time.Time `json:"timestamp,omitempty"`
IpAddress string `json:"ip_address,omitempty"`
Hostname string `json:"hostname,omitempty"`
ShortHostname string `json:"short_hostname,omitempty"`
Country string `json:"country,omitempty"`
UserAgent string `json:"user_agent,omitempty"`
}
func (*PublishableSource) ClearSensitiveData ¶
func (p *PublishableSource) ClearSensitiveData()
type PublishableStatus ¶
type PublishableStatus int
const ( PublishableSent PublishableStatus = iota PublishableQueued PublishablePublishing PublishablePublished PublishableDeleted PublishableDeclined PublishableHidden PublishableRemovedFB PublishableFailed PublishablePublishedManually )
type Report ¶
type Report struct {
Id string `json:"id" sql:",pk"`
ReportedId string `json:"reported_id"`
ReporterEmail string `json:"reporter_email"`
ReportedCarrier string `json:"reported_carrier"`
ReportedSecret string `json:"reported_secret"`
Reason ReportReason `json:"reason"`
Description string `json:"description"`
Timestamp time.Time `json:"timestamp"`
Status ReportStatus `json:"status"`
Resolver string `json:"resolver"`
}
type ReportReason ¶
type ReportReason int
const ( ReportDefamation ReportReason = iota ReportSuicide ReportOffensive ReportSexism ReportExtremism ReportOther )
type ReportStatus ¶
type ReportStatus int
const ( ReportSubmitted ReportStatus = iota ReportRevoked ReportAccepted ReportRejected ReportCompleted ReportElevated )
type Request ¶
type Request struct {
Id string `json:"id" sql:",pk"`
Status RequestStatus `json:"status"`
}
type RequestStatus ¶
type RequestStatus int
const ( RequestSubmitted RequestStatus = iota RequestRevoked RequestAccepted RequestRejected )
Click to show internal directories.
Click to hide internal directories.