model

package
v0.0.0-...-d5841c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func MarshalEmail

func MarshalEmail(email string) graphql.Marshaler

MarshalEmail passes email address to gqlgen email scalar

func MarshalMongoID

func MarshalMongoID(id primitive.ObjectID) graphql.Marshaler

MarshalMongoID takes primitive.ObjectID and passes it to gqlgen MongoID scalar

func MarshalMongoTime

func MarshalMongoTime(timestamp primitive.Timestamp) graphql.Marshaler

MarshalMongoTime passes the primitive.Timestamp to gqlgen MongoTime scalar

func UnmarshalEmail

func UnmarshalEmail(value interface{}) (string, error)

UnMarshalEmail verifies that the input is a valid email address

func UnmarshalMongoID

func UnmarshalMongoID(value interface{}) (primitive.ObjectID, error)

UnmarshalMongoID takes a GraphQL string and parses it to primitive.ObjectID

func UnmarshalMongoTime

func UnmarshalMongoTime(value interface{}) (primitive.Timestamp, error)

UnmarshalMongoTime verifies that the input is a valid ISO time and parses it to primitive.Timestamp

func VerifyEmailAddress

func VerifyEmailAddress(email string) bool

VerifyEmailAddress verifies that the input is a valid email address

Types

type FacebookCard

type FacebookCard 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 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 InitialSetupInput struct {
	SiteName string `json:"siteName" bson:"siteName,omitempty"`
	Name     string `json:"name" bson:"name,omitempty"`
	Email    string `json:"email" bson:"email,omitempty"`
	Password string `json:"password" bson:"password,omitempty"`
}

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 SEOInput

type SEOInput struct {
	Title       *string `json:"title" bson:"title,omitempty"`
	Description *string `json:"description" bson:"description,omitempty"`
	Image       *string `json:"image" bson:"image,omitempty"`
}

type Seo

type Seo struct {
	Title       *string `json:"title" bson:"title,omitempty"`
	Description *string `json:"description" bson:"description,omitempty"`
	Image       *string `json:"image" bson:"image,omitempty"`
}

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 Size

type Size struct {
	Width  int    `json:"width" bson:"width,omitempty"`
	Height int    `json:"height" bson:"height,omitempty"`
	URL    string `json:"url" bson:"url,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 SocialProfilesInput struct {
	Facebook *string `json:"facebook" bson:"facebook,omitempty"`
	Twitter  *string `json:"twitter" bson:"twitter,omitempty"`
}

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 StaffChangePasswordInput

type StaffChangePasswordInput struct {
	ID              string `json:"id" bson:"_id,omitempty"`
	Password        string `json:"password" bson:"password,omitempty"`
	ConfirmPassword string `json:"confirmPassword" bson:"confirmPassword,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 StaffInviteInput struct {
	Email string           `json:"email" bson:"email,omitempty"`
	Role  models.StaffRole `json:"role" bson:"role,omitempty"`
}

type StaffLoginInput

type StaffLoginInput struct {
	Email    string `json:"email" bson:"email,omitempty"`
	Password string `json:"password" bson:"password,omitempty"`
}

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 StaffRefreshTokenInput struct {
	AccessToken  string `json:"accessToken" bson:"accessToken,omitempty"`
	RefreshToken string `json:"refreshToken" bson:"refreshToken,omitempty"`
}

type StaffRefreshTokenResponse

type StaffRefreshTokenResponse struct {
	AccessToken  string `json:"accessToken" bson:"accessToken,omitempty"`
	RefreshToken string `json:"refreshToken" bson:"refreshToken,omitempty"`
}

type StaffRegisterInput

type StaffRegisterInput struct {
	Name     string           `json:"name" bson:"name,omitempty"`
	Email    string           `json:"email" bson:"email,omitempty"`
	Password string           `json:"password" bson:"password,omitempty"`
	Role     models.StaffRole `json:"role" bson:"role,omitempty"`
}

type StaffResetPasswordInput

type StaffResetPasswordInput struct {
	Email           string `json:"email" bson:"email,omitempty"`
	Code            string `json:"code" bson:"code,omitempty"`
	Password        string `json:"password" bson:"password,omitempty"`
	ConfirmPassword string `json:"confirmPassword" bson:"confirmPassword,omitempty"`
}

type StaffUpdateInput

type StaffUpdateInput struct {
	Name  string `json:"name" bson:"name,omitempty"`
	Email string `json:"email" bson:"email,omitempty"`
}

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 UpdateSEOSettingsInput struct {
	Title       string  `json:"title" bson:"title,omitempty"`
	Description string  `json:"description" bson:"description,omitempty"`
	Image       *string `json:"image" bson:"image,omitempty"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL