hashnode

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Endpoint = "https://api.hashnode.com"

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateArticleRequest

type CreateArticleRequest struct {
	Query     string `json:"query"`
	Variables struct {
		Input struct {
			Title               string `json:"title"`
			ContentMarkdown     string `json:"contentMarkdown"`
			Tags                []Tag  `json:"tags"`
			CoverImageURL       string `json:"coverImageURL"`
			IsPartOfPublication struct {
				PublicationId string `json:"publicationId"`
			} `json:"isPartOfPublication"`
		} `json:"input"`
	} `json:"variables"`
}

func NewCreateArticleRequest

func NewCreateArticleRequest() CreateArticleRequest

type GetPostRequest

type GetPostRequest struct {
	Query     string `json:"query"`
	Variables struct {
		Slug     string `json:"slug"`
		Hostname string `json:"hostname"`
	} `json:"variables"`
}

func NewGetPostRequest

func NewGetPostRequest() GetPostRequest

type Post

type Post struct {
	Slug  string `json:"slug"`
	Title string `json:"title"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(APIEndpoint string, authToken string) *Service

func (*Service) Exists

func (s *Service) Exists(ctx context.Context, slug, hostname string) (bool, error)

func (*Service) SubmitArticle

func (s *Service) SubmitArticle(ctx context.Context, article model.Article) error

type SubmitArticleResponse added in v1.0.5

type SubmitArticleResponse struct {
	Errors *any `json:"errors"`
}

type Tag

type Tag struct {
	Id   string `json:"_id"`
	Slug string `json:"slug"`
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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