ghost

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJWT

func CreateJWT() (string, error)

func CreateJWTX

func CreateJWTX() string

func ReplaceMobileDoc

func ReplaceMobileDoc(mobiledoc string, newMobiledoc string) string

func SetRequestHeadersForGhost

func SetRequestHeadersForGhost(req *http.Request)

Types

type Entity

type Entity interface {
	Request()
	PageEntity
}

type Errors

type Errors struct {
	GhostError []RequestError `json:"errors"`
}

type GhostSite

type GhostSite struct {
	Site struct {
		Title       string `json:"title"`
		Description string `json:"description,omitempty"`
		Logo        string `json:"logo,omitempty"`
		Icon        string `json:"icon,omitempty"`
		AccentColor string `json:"accent_color,omitempty"`
		Locale      string `json:"locale,omitempty"`
		URL         string `json:"url,omitempty"`
		Version     string `json:"version,omitempty"`
	} `json:"site"`
}

func RequestSite

func RequestSite() (GhostSite, error)

type PageEntity

type PageEntity struct {
	Pages []SingleRessource `json:"pages"`
}

func (PageEntity) Request

func (gp PageEntity) Request() error

func (PageEntity) UpdatePage

func (gp PageEntity) UpdatePage() error

type PostEntity

type PostEntity struct {
	Posts []SingleRessource `json:"posts"`
}

func (PostEntity) Request

func (gp PostEntity) Request() error

func (PostEntity) UpdatePost

func (gp PostEntity) UpdatePost() error

type RequestError

type RequestError struct {
	Message        string                `json:"message"`
	Context        string                `json:"context,omitempty"`
	Type           string                `json:"type"`
	Details        []RequestErrorDetails `json:"details,omitempty"`
	Property       string                `json:"property,omitempty"`
	Help           string                `json:"help,omitempty"`
	Code           string                `json:"code,omitempty"`
	Id             string                `json:"id"`
	GhostErrorCode string                `json:"ghostErrorCode,omitempty"`
}

type RequestErrorDetails

type RequestErrorDetails struct {
	Keyword    string `json:"keyword,omitempty"`
	DataPath   string `json:"dataPath,omitempty"`
	SchemaPath string `json:"schemaPath,omitempty"`
	Params     string `json:"params,omitempty"`
	Message    string `json:"message,omitempty"`
}

type SingleRessource

type SingleRessource struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Slug        string `json:"slug,omitempty"`
	UpdatedAt   string `json:"updated_at"`
	PublishedAt string `json:"published_at"`
	MobileDoc   string `json:"mobiledoc,omitempty"`
	HTML        string `json:"html,omitempty"`
	Status      string `json:"status,omitempty"`
	Featured    bool   `json:"featured,omitempty"`
	Excerpt     string `json:"custom_excerpt,omitempty"`
	Tags        []Tag  `json:"tags,omitempty"`
}

type Tag

type Tag struct {
	Name       string `json:"name,omitempty"`
	Slug       string `json:"slug,omitempty"`
	Visibility string `json:"visibility,omitempty"`
}

Jump to

Keyboard shortcuts

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