Documentation ¶
Overview ¶
Package almanack has business logic.
Index ¶
- Constants
- Variables
- func AddFlags(fl *flag.FlagSet) func() (svc Services, err error)
- func ArcFeedItemToBody(ctx context.Context, svc Services, arcStory *arc.FeedItem) (body string, warnings []string, err error)
- func ArcFeedItemToFrontmatter(ctx context.Context, svc Services, arcStory *arc.FeedItem) (fm map[string]any, err error)
- func FetchImageURL(ctx context.Context, c *http.Client, srcurl string) (body []byte, ctype string, err error)
- func GetSignedFileUpload(ctx context.Context, is aws.BlobStore, filename, mimetype string) (signedURL, fileURL, disposition, cachecontrol string, err error)
- func GetSignedImageUpload(ctx context.Context, is aws.BlobStore, ct string) (signedURL, filename string, err error)
- func MessageForLoc(loc string) string
- func UploadJSON(ctx context.Context, is aws.BlobStore, filepath, cachecontrol string, data any) error
- type ScheduledSiteConfig
- type Services
- func (svc Services) ConfigureGoogleCert(ctx context.Context) (err error)
- func (svc Services) CreateGDocsDoc(ctx context.Context, externalID string) (dbDoc *db.GDocsDoc, err error)
- func (svc Services) CreatePageFromArcSource(ctx context.Context, shared *db.SharedArticle, kind string) (warnings []string, err error)
- func (svc Services) CreatePageFromGDocsDoc(ctx context.Context, shared *db.SharedArticle, kind string) (err error)
- func (svc Services) ImportNewsletterPages(ctx context.Context, types []db.NewsletterType) (err error)
- func (svc Services) InflateSharedArticle(ctx context.Context, a *db.SharedArticle) (v any, err error)
- func (svc Services) Notify(ctx context.Context, page *db.Page, publishingNow bool) (err error)
- func (svc Services) PopScheduledPages(ctx context.Context) (err, warning error)
- func (svc Services) PopScheduledSiteChanges(ctx context.Context, loc string) error
- func (svc Services) ProcessGDocs(ctx context.Context) error
- func (svc Services) ProcessGDocsDoc(ctx context.Context, dbDoc db.GDocsDoc) (err error)
- func (svc Services) PublishPage(ctx context.Context, txq *db.Queries, page *db.Page) (err, warning error)
- func (svc Services) PublishSiteConfig(ctx context.Context, siteConfig *db.SiteDatum) (err error)
- func (svc Services) RefreshArcFromFeed(ctx context.Context) (fatal bool, merr error)
- func (svc Services) RefreshPageContents(ctx context.Context, id int64) (err error)
- func (svc Services) RefreshPageFromArcStory(ctx context.Context, page *db.Page, story *db.Arc, refreshMetadata bool) (warnings []string, err error)
- func (svc Services) RefreshPageFromContentStore(ctx context.Context, page *db.Page) (err error)
- func (svc Services) RefreshPageFromMailchimp(ctx context.Context, page *db.Page) (err error)
- func (svc Services) ReplaceAndUploadImageURL(ctx context.Context, srcURL, description, credit string) (path string, err error)
- func (svc Services) ReplaceImageURL(ctx context.Context, srcURL, description, credit string) (s string, err error)
- func (svc Services) SaveNewsletterPage(ctx context.Context, nl *db.Newsletter, body string, types []db.NewsletterType) (err error)
- func (svc Services) UpdateMostPopular(ctx context.Context) (err error)
- func (svc Services) UpdateNewsletterArchive(ctx context.Context, campaigns *mailchimp.ListCampaignsResp, ...) (err error)
- func (svc Services) UpdateNewsletterArchives(ctx context.Context, types []db.NewsletterType) (err error)
- func (svc Services) UpdateSiteConfig(ctx context.Context, loc string, configs []ScheduledSiteConfig) ([]db.SiteDatum, error)
- func (svc Services) UploadGDocsImage(ctx context.Context, arg UploadGDocsImageParams) (err error)
- func (svc Services) UploadPendingImages(ctx context.Context) error
- func (svc Services) UpsertSharedArticleForGDoc(ctx context.Context, dbDoc *db.GDocsDoc, refreshMetadata bool) (*db.SharedArticle, error)
- type SharedArticle
- type SharedArticleGDoc
- type UploadGDocsImageParams
Constants ¶
View Source
const ( HomepageLoc = "data/editorsPicks.json" SidebarLoc = "data/sidebar.json" SiteParamsLoc = "config/_default/params.json" StateCollegeLoc = "data/stateCollege.json" ElectionFeatLoc = "data/elections.json" )
Variables ¶
View Source
var ( BuildVersion = versioninfo.Revision DeployURL = strings.TrimSpace(deployURL) )
Functions ¶
func ArcFeedItemToBody ¶
func FetchImageURL ¶
func GetSignedFileUpload ¶
func GetSignedImageUpload ¶
func MessageForLoc ¶
Types ¶
type ScheduledSiteConfig ¶
type Services ¶
type Services struct { MailchimpSignupURL string NetlifyWebhookSecret string Client *http.Client Queries *db.Queries Tx *db.Txable github.ContentStore ImageStore aws.BlobStore FileStore aws.BlobStore SlackSocial *slackhook.Client SlackTech *slackhook.Client Indexer index.Indexer NewletterService mailchimp.V3 Gsvc *google.Service mailchimp.EmailService Plausible plausible.API // contains filtered or unexported fields }
func (Services) ConfigureGoogleCert ¶
func (Services) CreateGDocsDoc ¶
func (Services) CreatePageFromArcSource ¶
func (Services) CreatePageFromGDocsDoc ¶
func (Services) ImportNewsletterPages ¶
func (Services) InflateSharedArticle ¶
func (Services) PopScheduledPages ¶
func (Services) PopScheduledSiteChanges ¶
func (Services) ProcessGDocsDoc ¶
func (Services) PublishPage ¶
func (Services) PublishSiteConfig ¶
func (Services) RefreshArcFromFeed ¶
func (Services) RefreshPageContents ¶
func (Services) RefreshPageFromArcStory ¶
func (Services) RefreshPageFromContentStore ¶
func (Services) RefreshPageFromMailchimp ¶
func (Services) ReplaceAndUploadImageURL ¶
func (Services) ReplaceImageURL ¶
func (Services) SaveNewsletterPage ¶
func (svc Services) SaveNewsletterPage(ctx context.Context, nl *db.Newsletter, body string, types []db.NewsletterType) (err error)
func (Services) UpdateMostPopular ¶
func (Services) UpdateNewsletterArchive ¶
func (Services) UpdateNewsletterArchives ¶
func (Services) UpdateSiteConfig ¶
func (Services) UploadGDocsImage ¶
func (svc Services) UploadGDocsImage(ctx context.Context, arg UploadGDocsImageParams) (err error)
func (Services) UploadPendingImages ¶
type SharedArticle ¶
type SharedArticle struct {}
type SharedArticleGDoc ¶
type SharedArticleGDoc struct {}
type UploadGDocsImageParams ¶
type UploadGDocsImageParams struct { ExternalID string DocObjectID string ImageURL string Embed *db.EmbedImage // In-out param }
Click to show internal directories.
Click to hide internal directories.