Documentation ¶
Index ¶
- Variables
- func MarshalEmail(email string) graphql.Marshaler
- func MarshalMongoID(id primitive.ObjectID) graphql.Marshaler
- func MarshalMongoTime(timestamp primitive.Timestamp) graphql.Marshaler
- func UnmarshalEmail(value interface{}) (string, error)
- func UnmarshalMongoID(value interface{}) (primitive.ObjectID, error)
- func UnmarshalMongoTime(value interface{}) (primitive.Timestamp, error)
- func VerifyEmailAddress(email string) bool
- type FacebookCard
- type Image
- type InitialSetupInput
- type InitialSetupResponse
- type Member
- type MemberSubscription
- type Page
- type Post
- type PostOrPageStatus
- type SEOInput
- type Seo
- type SiteSettings
- type Size
- type Sizes
- type SocialProfiles
- type SocialProfilesInput
- type StaffAcceptInviteInput
- type StaffChangePasswordInput
- type StaffDeleteInput
- type StaffForgotPasswordInput
- type StaffInviteInput
- type StaffLoginInput
- type StaffLoginResponse
- type StaffRefreshTokenInput
- type StaffRefreshTokenResponse
- type StaffRegisterInput
- type StaffResetPasswordInput
- type StaffUpdateInput
- type Tag
- type TwitterCard
- type UpdateFacebookCardSettingsInput
- type UpdatePageInput
- type UpdatePageStatusInput
- type UpdatePostInput
- type UpdatePostStatusInput
- type UpdateSEOSettingsInput
- type UpdateSiteSettingsInput
- type UpdateTwitterCardSettingsInput
Constants ¶
This section is empty.
Variables ¶
View Source
var AllPostOrPageStatus = []PostOrPageStatus{ PostOrPageStatusPublished, PostOrPageStatusDraft, PostOrPageStatusPending, PostOrPageStatusScheduled, PostOrPageStatusTrashed, }
Functions ¶
func MarshalEmail ¶
MarshalEmail passes email address to gqlgen email scalar
func MarshalMongoID ¶
MarshalMongoID takes primitive.ObjectID and passes it to gqlgen MongoID scalar
func MarshalMongoTime ¶
MarshalMongoTime passes the primitive.Timestamp to gqlgen MongoTime scalar
func UnmarshalEmail ¶
UnMarshalEmail verifies that the input is a valid email address
func UnmarshalMongoID ¶
UnmarshalMongoID takes a GraphQL string and parses it to primitive.ObjectID
func UnmarshalMongoTime ¶
UnmarshalMongoTime verifies that the input is a valid ISO time and parses it to primitive.Timestamp
func VerifyEmailAddress ¶
VerifyEmailAddress verifies that the input is a valid email address
Types ¶
type FacebookCard ¶
type Image ¶
type Image struct { ID string `json:"id" bson:"_id,omitempty"` Slug string `json:"slug" bson:"slug,omitempty"` URL string `json:"url" bson:"url,omitempty"` Alt *string `json:"alt" bson:"alt,omitempty"` Caption *string `json:"caption" bson:"caption,omitempty"` Description *string `json:"description" bson:"description,omitempty"` Sizes *Sizes `json:"sizes" bson:"sizes,omitempty"` }
type InitialSetupInput ¶
type InitialSetupResponse ¶
type InitialSetupResponse struct { Staff *models.StaffMember `json:"staff" bson:"staff,omitempty"` AccessToken string `json:"accessToken" bson:"accessToken,omitempty"` RefreshToken string `json:"refreshToken" bson:"refreshToken,omitempty"` }
type Member ¶
type Member struct { ID string `json:"id" bson:"_id,omitempty"` Name string `json:"name" bson:"name,omitempty"` Email string `json:"email" bson:"email,omitempty"` // Email address verification is vital for sending subscription IsEmailVerified bool `json:"isEmailVerified" bson:"isEmailVerified,omitempty"` // Password is optional as members might not need to login Password *string `json:"password" bson:"password,omitempty"` Subscription []*MemberSubscription `json:"subscription" bson:"subscription,omitempty"` CreatedAt time.Time `json:"createdAt" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt,omitempty"` }
type MemberSubscription ¶
type MemberSubscription struct { ID string `json:"id" bson:"_id,omitempty"` Title string `json:"title" bson:"title,omitempty"` Description string `json:"description" bson:"description,omitempty"` // For free subscriptions, this is set to 0 Price *string `json:"price" bson:"price,omitempty"` CreatedAt time.Time `json:"createdAt" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt,omitempty"` }
type Page ¶
type Page struct { ID string `json:"id" bson:"_id,omitempty"` Title string `json:"title" bson:"title,omitempty"` Slug string `json:"slug" bson:"slug,omitempty"` Excerpt *string `json:"excerpt" bson:"excerpt,omitempty"` Content string `json:"content" bson:"content,omitempty"` FeaturedImage *Image `json:"featuredImage" bson:"featuredImage,omitempty"` // SEO metadata details for the page Seo *Seo `json:"seo" bson:"seo,omitempty"` PublishedAt time.Time `json:"publishedAt" bson:"publishedAt,omitempty"` CreatedAt time.Time `json:"createdAt" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt,omitempty"` }
type Post ¶
type Post struct { ID string `json:"id" bson:"_id,omitempty"` Title string `json:"title" bson:"title,omitempty"` Slug string `json:"slug" bson:"slug,omitempty"` IsFeatured bool `json:"isFeatured" bson:"isFeatured,omitempty"` Excerpt *string `json:"excerpt" bson:"excerpt,omitempty"` Content string `json:"content" bson:"content,omitempty"` FeaturedImage *Image `json:"featuredImage" bson:"featuredImage,omitempty"` // SEO metadata details for the post or page Seo *Seo `json:"seo" bson:"seo,omitempty"` // Members who have access to this post - this is determined by subscription groups // they are part of. PostAccess []*MemberSubscription `json:"postAccess" bson:"postAccess,omitempty"` PublishedAt time.Time `json:"publishedAt" bson:"publishedAt,omitempty"` CreatedAt time.Time `json:"createdAt" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt,omitempty"` }
type PostOrPageStatus ¶
type PostOrPageStatus string
const ( PostOrPageStatusPublished PostOrPageStatus = "PUBLISHED" PostOrPageStatusDraft PostOrPageStatus = "DRAFT" PostOrPageStatusPending PostOrPageStatus = "PENDING" PostOrPageStatusScheduled PostOrPageStatus = "SCHEDULED" PostOrPageStatusTrashed PostOrPageStatus = "TRASHED" )
func (PostOrPageStatus) IsValid ¶
func (e PostOrPageStatus) IsValid() bool
func (PostOrPageStatus) MarshalGQL ¶
func (e PostOrPageStatus) MarshalGQL(w io.Writer)
func (PostOrPageStatus) String ¶
func (e PostOrPageStatus) String() string
func (*PostOrPageStatus) UnmarshalGQL ¶
func (e *PostOrPageStatus) UnmarshalGQL(v interface{}) error
type SiteSettings ¶
type SiteSettings struct { ID primitive.ObjectID `json:"id" bson:"_id,omitempty"` // The name of the site. SiteName string `json:"siteName" bson:"siteName,omitempty"` // The description of the site. Can be used for meta description. SiteDescription *string `json:"siteDescription" bson:"siteDescription,omitempty"` // The time zone the the site is in. This is for content times of publication // i.e. published at, updated at etc. Timezone string `json:"timezone" bson:"timezone,omitempty"` // The base url of the frontend application that will serve the site, this will // allow for the base URL to be appended to URLs generated by the backend. BaseURL string `json:"baseURL" bson:"baseURL,omitempty"` // Links to social media sites i.e. Twitter, Facebook, etc. SocialProfiles *SocialProfiles `json:"socialProfiles" bson:"socialProfiles,omitempty"` // Search Engine Optimization (SEO) settings for the entire site Seo *Seo `json:"seo" bson:"seo,omitempty"` // Twitter card settings for the entire site TwitterCard *TwitterCard `json:"twitterCard" bson:"twitterCard,omitempty"` // Facebook card settings for the entire site FacebookCard *FacebookCard `json:"facebookCard" bson:"facebookCard,omitempty"` CreatedAt primitive.Timestamp `json:"createdAt" bson:"createdAt,omitempty"` UpdatedAt primitive.Timestamp `json:"updatedAt" bson:"updatedAt,omitempty"` }
type Sizes ¶
type Sizes struct { Thumbnail *Size `json:"thumbnail" bson:"thumbnail,omitempty"` Medium *Size `json:"medium" bson:"medium,omitempty"` MediumLarge *Size `json:"medium_large" bson:"medium_large,omitempty"` Large *Size `json:"large" bson:"large,omitempty"` Full *Size `json:"full" bson:"full,omitempty"` }
type SocialProfiles ¶
type SocialProfiles struct { Facebook *string `json:"facebook" bson:"facebook,omitempty"` Twitter *string `json:"twitter" bson:"twitter,omitempty"` }
Links to social media sites i.e. Twitter, Facebook, etc.
type SocialProfilesInput ¶
type StaffAcceptInviteInput ¶
type StaffAcceptInviteInput struct { Email string `json:"email" bson:"email,omitempty"` Name string `json:"name" bson:"name,omitempty"` Password string `json:"password" bson:"password,omitempty"` ConfirmPassword string `json:"confirmPassword" bson:"confirmPassword,omitempty"` Code string `json:"code" bson:"code,omitempty"` }
type StaffDeleteInput ¶
type StaffDeleteInput struct {
ID string `json:"id" bson:"_id,omitempty"`
}
type StaffForgotPasswordInput ¶
type StaffForgotPasswordInput struct {
Email string `json:"email" bson:"email,omitempty"`
}
type StaffInviteInput ¶
type StaffLoginInput ¶
type StaffLoginResponse ¶
type StaffLoginResponse struct { Staff *models.StaffMember `json:"staff" bson:"staff,omitempty"` AccessToken string `json:"accessToken" bson:"accessToken,omitempty"` RefreshToken string `json:"refreshToken" bson:"refreshToken,omitempty"` }
type StaffRefreshTokenInput ¶
type StaffRegisterInput ¶
type StaffResetPasswordInput ¶
type StaffUpdateInput ¶
type Tag ¶
type Tag struct { ID string `json:"id" bson:"_id,omitempty"` Title string `json:"title" bson:"title,omitempty"` Slug string `json:"slug" bson:"slug,omitempty"` Image *Image `json:"image" bson:"image,omitempty"` Description *string `json:"description" bson:"description,omitempty"` CreatedAt time.Time `json:"createdAt" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt,omitempty"` }
type TwitterCard ¶
type TwitterCard struct { Card *string `json:"card" bson:"card,omitempty"` Site *string `json:"site" bson:"site,omitempty"` Title *string `json:"title" bson:"title,omitempty"` Description *string `json:"description" bson:"description,omitempty"` Image *string `json:"image" bson:"image,omitempty"` Creator *string `json:"creator" bson:"creator,omitempty"` }
type UpdateFacebookCardSettingsInput ¶
type UpdateFacebookCardSettingsInput struct { Type string `json:"type" bson:"type,omitempty"` Title string `json:"title" bson:"title,omitempty"` Description string `json:"description" bson:"description,omitempty"` Image *string `json:"image" bson:"image,omitempty"` URL string `json:"url" bson:"url,omitempty"` }
type UpdatePageInput ¶
type UpdatePageInput struct { Title *string `json:"title" bson:"title,omitempty"` Content *string `json:"content" bson:"content,omitempty"` Excerpt *string `json:"excerpt" bson:"excerpt,omitempty"` FeaturedImage *string `json:"featuredImage" bson:"featuredImage,omitempty"` // If a post is featured, default to false. IsFeatured *bool `json:"isFeatured" bson:"isFeatured,omitempty"` // List of subscription groups with access to the the post PostAccess []string `json:"postAccess" bson:"postAccess,omitempty"` Seo *SEOInput `json:"seo" bson:"seo,omitempty"` }
type UpdatePageStatusInput ¶
type UpdatePageStatusInput struct { ID string `json:"id" bson:"_id,omitempty"` Status PostOrPageStatus `json:"status" bson:"status,omitempty"` }
type UpdatePostInput ¶
type UpdatePostInput struct { Title *string `json:"title" bson:"title,omitempty"` Content *string `json:"content" bson:"content,omitempty"` Excerpt *string `json:"excerpt" bson:"excerpt,omitempty"` FeaturedImage *string `json:"featuredImage" bson:"featuredImage,omitempty"` // If a post is featured, default to false. IsFeatured *bool `json:"isFeatured" bson:"isFeatured,omitempty"` // List of subscription groups with access to the the post PostAccess []string `json:"postAccess" bson:"postAccess,omitempty"` Seo *SEOInput `json:"seo" bson:"seo,omitempty"` }
type UpdatePostStatusInput ¶
type UpdatePostStatusInput struct { ID string `json:"id" bson:"_id,omitempty"` Status PostOrPageStatus `json:"status" bson:"status,omitempty"` }
type UpdateSEOSettingsInput ¶
type UpdateSiteSettingsInput ¶
type UpdateSiteSettingsInput struct { SiteName string `json:"siteName" bson:"siteName,omitempty"` BaseURL string `json:"baseURL" bson:"baseURL,omitempty"` SiteDescription *string `json:"siteDescription" bson:"siteDescription,omitempty"` Timezone string `json:"timezone" bson:"timezone,omitempty"` SocialProfiles *SocialProfilesInput `json:"socialProfiles" bson:"socialProfiles,omitempty"` }
type UpdateTwitterCardSettingsInput ¶
type UpdateTwitterCardSettingsInput struct { Card string `json:"card" bson:"card,omitempty"` Site *string `json:"site" bson:"site,omitempty"` Title string `json:"title" bson:"title,omitempty"` Description string `json:"description" bson:"description,omitempty"` Image *string `json:"image" bson:"image,omitempty"` Creator *string `json:"creator" bson:"creator,omitempty"` }
Click to show internal directories.
Click to hide internal directories.