Documentation
¶
Index ¶
- Constants
- type Attribution
- type EmailSuppression
- type Ghost
- func (g *Ghost) AdminCreateMember(member NewMember) (Members, error)
- func (g *Ghost) AdminCreatePage(page Page) (Pages, error)
- func (g *Ghost) AdminCreatePost(post Post) (Posts, error)
- func (g *Ghost) AdminCreateTags(tags NewTags) error
- func (g *Ghost) AdminDeleteMember(memberId string) error
- func (g *Ghost) AdminDeletePage(pageId string) error
- func (g *Ghost) AdminDeletePost(postId string) error
- func (g *Ghost) AdminDeleteTag(tag Tag) error
- func (g *Ghost) AdminGetMember(memberId string) (Members, error)
- func (g *Ghost) AdminGetMembers() (Members, error)
- func (g *Ghost) AdminGetPage(pageId string) (Pages, error)
- func (g *Ghost) AdminGetPages() (Pages, error)
- func (g *Ghost) AdminGetPost(postId string) (Posts, error)
- func (g *Ghost) AdminGetPosts() (Posts, error)
- func (g *Ghost) AdminGetPostsByTag(tag string) (Posts, error)
- func (g *Ghost) AdminGetPostsPaginated(page, limit int, order string) (Posts, error)
- func (g *Ghost) AdminGetTags() (Tags, error)
- func (g *Ghost) AdminSearchPosts(query string) (Posts, error)
- func (g *Ghost) AdminUpdatePage(page Page, sourceType SourceType) error
- func (g *Ghost) AdminUpdatePost(post Post, sourceType SourceType) error
- func (g *Ghost) AdminUpdateTag(tag Tag) error
- func (g *Ghost) AdminUploadImage(path string) (imageURL string, err error)
- func (g *Ghost) GetPages() (Pages, error)
- func (g *Ghost) GetPost(postId string) (Posts, error)
- func (g *Ghost) GetPosts() (Posts, error)
- func (g *Ghost) GetPostsByTag(tag string) (Posts, error)
- type Image
- type ImageResponse
- type Member
- type Members
- type NewMember
- type NewMembers
- type NewTag
- type NewTags
- type Newsletter
- type Page
- type Pages
- type Pagination
- type Post
- type PostRevision
- type Posts
- type SourceType
- type Subscription
- type Tag
- type Tags
- type Tier
Constants ¶
View Source
const StatusPublished = "published"
StatusPublished indicates if a post or pages is already published
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribution ¶
type EmailSuppression ¶
type EmailSuppression struct {
Suppressed bool `json:"suppressed"`
Info interface{} `json:"info"`
}
type Ghost ¶
type Ghost struct {
// contains filtered or unexported fields
}
func (*Ghost) AdminCreateMember ¶
func (*Ghost) AdminCreateTags ¶
func (*Ghost) AdminDeleteMember ¶
func (*Ghost) AdminDeletePage ¶
func (*Ghost) AdminDeletePost ¶
func (*Ghost) AdminDeleteTag ¶
func (*Ghost) AdminGetMembers ¶
func (*Ghost) AdminGetPages ¶
func (*Ghost) AdminGetPosts ¶
func (*Ghost) AdminGetPostsPaginated ¶
AdminGetPostsPaginated returns a single page of posts with pagination metadata. Use this instead of AdminGetPosts when dealing with large numbers of posts. Parameters:
- page: 1-indexed page number
- limit: number of posts per page (max 100)
- order: sort order, e.g. "published_at desc", "updated_at desc", "title asc"
func (*Ghost) AdminGetTags ¶
func (*Ghost) AdminSearchPosts ¶
AdminSearchPosts searches for posts matching the query in title or custom_excerpt. Uses Ghost Admin API filter to search server-side across all posts.
func (*Ghost) AdminUpdatePage ¶
func (g *Ghost) AdminUpdatePage(page Page, sourceType SourceType) error
func (*Ghost) AdminUpdatePost ¶
func (g *Ghost) AdminUpdatePost(post Post, sourceType SourceType) error
func (*Ghost) AdminUpdateTag ¶
func (*Ghost) AdminUploadImage ¶
AdminUploadImage - Creates a new file upload http request
type ImageResponse ¶
type ImageResponse struct {
Images []Image
}
type Member ¶
type Member struct {
Id string `json:"id"`
Uuid string `json:"uuid"`
Email string `json:"email"`
Name string `json:"name"`
Note interface{} `json:"note"`
Geolocation interface{} `json:"geolocation"`
Subscribed bool `json:"subscribed"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Labels []struct {
Id string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
} `json:"labels"`
Subscriptions []Subscription `json:"subscriptions"`
AvatarImage string `json:"avatar_image"`
Comped bool `json:"comped"`
EmailCount int `json:"email_count"`
EmailOpenedCount int `json:"email_opened_count"`
EmailOpenRate *float64 `json:"email_open_rate"`
Status string `json:"status"`
LastSeenAt *time.Time `json:"last_seen_at"`
UnsubscribeUrl string `json:"unsubscribe_url"`
Tiers []Tier `json:"tiers"`
EmailSuppression EmailSuppression `json:"email_suppression"`
Newsletters []Newsletter `json:"newsletters"`
Attribution *Attribution `json:"attribution,omitempty"`
}
type Members ¶
type Members struct {
Members []Member `json:"members"`
Meta Pagination `json:"meta,omitempty"`
}
type NewMembers ¶
type NewMembers struct {
Members []NewMember `json:"members"`
}
type NewTag ¶
type NewTag struct {
CreatedAt time.Time `json:"created_at,omitempty"`
Description string `json:"description,omitempty"`
FeatureImage string `json:"feature_image,omitempty"`
Id string `json:"id,omitempty"`
MetaDescription string `json:"meta_description,omitempty"`
MetaTitle string `json:"meta_title,omitempty"`
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Url string `json:"url,omitempty"`
Visibility string `json:"visibility,omitempty"`
TwitterImage string `json:"twitter_image,omitempty"`
TwitterTitle string `json:"twitter_title,omitempty"`
TwitterDescription string `json:"twitter_description,omitempty"`
CodeInjectionHead string `json:"codeinjection_head,omitempty"`
CodeInjectionFoot string `json:"codeinjection_foot,omitempty"`
CanonicalURL string `json:"canonical_url,omitempty"`
AccentColor string `json:"accent_color,omitempty"`
}
NewTag - two struct because field "Count" must not exist when creating a new tag
type Newsletter ¶
type Page ¶
type Page struct {
ID string `json:"id,omitempty"`
UUID string `json:"uuid,omitempty"`
Title string `json:"title,omitempty"`
MobileDoc string `json:"mobiledoc,omitempty"`
Lexical string `json:"lexical,omitempty"`
Slug string `json:"slug,omitempty"`
HTML string `json:"html,omitempty"`
CommentID string `json:"comment_id,omitempty"`
FeatureImage string `json:"feature_image,omitempty"`
Featured bool `json:"featured,omitempty"`
Page bool `json:"page,omitempty"`
MetaTitle string `json:"meta_title,omitempty"`
MetaDescription string `json:"meta_description,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
PublishedAt string `json:"published_at,omitempty"`
CustomExcerpt string `json:"custom_excerpt,omitempty"`
OGImage string `json:"og_image,omitempty"`
OGTitle string `json:"og_title,omitempty"`
OGDescription string `json:"og_description,omitempty"`
TwitterImage string `json:"twitter_image,omitempty"`
TwitterTitle string `json:"twitter_title,omitempty"`
TwitterDescription string `json:"twitter_description,omitempty"`
CustomTemplate string `json:"custom_template,omitempty"`
URL string `json:"url,omitempty"`
Excerpt string `json:"excerpt,omitempty"`
Status string `json:"status,omitempty"`
Visibility string `json:"visibility,omitempty"`
Tags []Tag `json:"tags,omitempty"`
}
type Pagination ¶
type Post ¶
type Post struct {
ID string `json:"id,omitempty"`
UUID string `json:"uuid,omitempty"`
Title string `json:"title,omitempty"`
Lexical string `json:"lexical,omitempty"`
MobileDoc string `json:"mobiledoc,omitempty"`
Slug string `json:"slug,omitempty"`
HTML string `json:"html,omitempty"`
CommentID string `json:"comment_id,omitempty"`
FeatureImage string `json:"feature_image,omitempty"`
Featured bool `json:"featured,omitempty"`
Page bool `json:"page,omitempty"`
MetaTitle string `json:"meta_title,omitempty"`
MetaDescription string `json:"meta_description,omitempty"`
CreatedAt string `json:"created_at,omitempty"` // "2022-01-05T22:39:28.000Z"
UpdatedAt string `json:"updated_at,omitempty"` // "2022-04-02T16:01:24.000Z"
PublishedAt string `json:"published_at,omitempty"` // "2022-01-19T06:31:00.000Z"
CustomExcerpt string `json:"custom_excerpt,omitempty"`
OGImage string `json:"og_image,omitempty"`
OGTitle string `json:"og_title,omitempty"`
OGDescription string `json:"og_description,omitempty"`
TwitterImage string `json:"twitter_image,omitempty"`
TwitterTitle string `json:"twitter_title,omitempty"`
TwitterDescription string `json:"twitter_description,omitempty"`
CustomTemplate string `json:"custom_template,omitempty"`
URL string `json:"url,omitempty"`
Excerpt string `json:"excerpt,omitempty"`
Tags []Tag `json:"tags,omitempty"`
Status string `json:"status,omitempty"` // "published"
Visibility string `json:"visibility,omitempty"` // "public"
PostRevisions []PostRevision `json:"post_revisions,omitempty"`
}
type PostRevision ¶
type PostRevision struct {
ID string `json:"id,omitempty"`
PostID string `json:"post_id,omitempty"`
Lexical string `json:"lexical,omitempty"`
MobileDoc string `json:"mobiledoc,omitempty"`
CreatedAtTs int64 `json:"created_at_ts,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Title string `json:"title,omitempty"`
PostStatus string `json:"post_status,omitempty"`
Reason string `json:"reason,omitempty"`
Author struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
Email string `json:"email,omitempty"`
ProfileImage string `json:"profile_image,omitempty"`
CoverImage string `json:"cover_image,omitempty"`
Bio string `json:"bio,omitempty"`
Website string `json:"website,omitempty"`
Location string `json:"location,omitempty"`
Facebook string `json:"facebook,omitempty"`
Twitter string `json:"twitter,omitempty"`
Accessibility string `json:"accessibility,omitempty"`
Status string `json:"status,omitempty"`
MetaTitle string `json:"meta_title,omitempty"`
MetaDescription string `json:"meta_description,omitempty"`
Tour string `json:"tour,omitempty"`
LastSeen string `json:"last_seen,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
} `json:"author,omitempty"`
}
type Posts ¶
type Posts struct {
Posts []Post `json:"posts"`
Meta Pagination `json:"meta,omitempty"`
}
type SourceType ¶
type SourceType string
const ( Sourcelexical SourceType = "lexical" // deprecated SourceHTML SourceType = "html" SourceLexical SourceType = "lexical" // default )
type Subscription ¶
type Subscription struct {
Id string `json:"id"`
Customer struct {
Id string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
} `json:"customer"`
Status string `json:"status"`
StartDate time.Time `json:"start_date"`
DefaultPaymentCardLast4 string `json:"default_payment_card_last4"`
CancelAtPeriodEnd bool `json:"cancel_at_period_end"`
CancellationReason string `json:"cancellation_reason"`
CurrentPeriodEnd time.Time `json:"current_period_end"`
Price struct {
Id string `json:"id"`
PriceId string `json:"price_id"`
Nickname string `json:"nickname"`
Amount int `json:"amount"`
Interval string `json:"interval"`
Type string `json:"type"`
Currency string `json:"currency"`
} `json:"price"`
}
type Tag ¶
type Tag struct {
CreatedAt time.Time `json:"created_at,omitempty"`
Description string `json:"description,omitempty"`
FeatureImage string `json:"feature_image,omitempty"`
Id string `json:"id,omitempty"`
MetaDescription string `json:"meta_description,omitempty"`
MetaTitle string `json:"meta_title,omitempty"`
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Url string `json:"url,omitempty"`
Visibility string `json:"visibility,omitempty"`
TwitterImage string `json:"twitter_image,omitempty"`
TwitterTitle string `json:"twitter_title,omitempty"`
TwitterDescription string `json:"twitter_description,omitempty"`
CodeInjectionHead string `json:"codeinjection_head,omitempty"`
CodeInjectionFoot string `json:"codeinjection_foot,omitempty"`
CanonicalURL string `json:"canonical_url,omitempty"`
AccentColor string `json:"accent_color,omitempty"`
Count struct {
Posts int `json:"posts,omitempty"`
} `json:"count,omitempty,skip"`
}
type Tags ¶
type Tags struct {
Tags []Tag `json:"tags"`
Meta Pagination `json:"meta,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.