Categorygithub.com/writeas/go-ghost
modulepackage
0.1.0
Repository: https://github.com/writeas/go-ghost.git
Documentation: pkg.go.dev

# README

go-ghost

Go Reference

go-ghost is a Go (golang) library for accessing the Ghost API.

This library is incomplete, and tailored toward our Write.as / WriteFreely integration. But contributions (including those to support the full Ghost API) are welcome!

Install

go get -u github.com/writeas/go-ghost

Usage

Create a post:

import (
	"github.com/writeas/go-ghost"
	"github.com/writeas/go-ghost/admin"
)

func main() {
	// NewClient takes your Ghost URL and admin API key
	c := ghost.NewClient("http://localhost:2368", "fc765549cb7e9d05d5ecf2c9:d3e6d27fcf782ceebea59024010aec...")
	err := admin.AddPost(c, ghost.PostParams{
		Title:    ghost.String("My Post Title"),
		Markdown: ghost.String(`This is a **test post** made with the [go-ghost](https://github.com/writeas/go-ghost) library.`),
		Status:   ghost.String("published"),
	})
	if err != nil {
		// Handle error
	}
}

# Packages

Package admin supports interacting with the Ghost Admin API.
No description provided by the author

# Functions

Bool returns a pointer to the bool value passed in.
NewClient creates a new API Client.
String returns a pointer to the string value passed in.

# Structs

Author represents an author on Ghost.
Client stores the necessary values for interacting with the Ghost API.
Error represents an error returned from the Ghost API.
Post
No description provided by the author
No description provided by the author
Tag represents a tag on Ghost.