cms

package
v0.0.0-...-7c4a8a6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCMSClient

func NewCMSClient(sanityClient *sanity.Client) *cmsClient

Types

type Category

type Category struct {
	ID    string   `json:"id"`
	Names []string `json:"names"`
}

type Client

type Client interface {
	GetFeaturedPosts(ctx context.Context) (*GetFeaturedPostsResponse, error)
}

type GetFeaturedPostsResponse

type GetFeaturedPostsResponse struct {
	Title string  `json:"title"`
	Posts []*Post `json:"posts"`
}

type Image

type Image struct {
	Type  string `json:"_type"`
	Asset struct {
		Ref  string `json:"_ref"`
		Type string `json:"_type"`
	} `json:"asset"`
}

type Post

type Post struct {
	Slug        string      `json:"slug"`
	Title       string      `json:"title"`
	Description string      `json:"description"`
	MainImage   *Image      `json:"mainImage"`
	PublishedAt time.Time   `json:"publishedAt"`
	Categories  []*Category `json:"categories"`
}

Jump to

Keyboard shortcuts

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