fetch

package
v0.0.0-...-5c6ceab Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FeedTypes = []string{
	"FEATURED",
	"PERSONALIZED",
	"FOLLOWING",
	"RECENT",
	"RELEVANT",
	"BOOKMARKS",
	"READING_HISTORY",
}

Functions

This section is empty.

Types

type Feed

type Feed struct {
	Data struct {
		Feed struct {
			Edges []struct {
				Node utils.Post `json:"node"`
			} `json:"edges"`
			PageInfo struct {
				HasNextPage bool   `json:"hasNextPage"`
				EndCursor   string `json:"endCursor"`
			} `json:"pageInfo"`
		} `json:"feed"`
	} `json:"data"`
	Errors []utils.Error `json:"errors"`
}

func FeedResponse

func FeedResponse(
	r chan struct{},
	feedType string,
	minRead int,
	maxRead int,
	after string,
) Feed

type Like

type Like struct {
	Data struct {
		Like struct {
			Post struct {
				Id string `json:"id"`
			} `json:"post"`
		} `json:"likePost"`
	} `json:"data"`
	Errors []utils.Error `json:"errors"`
}

func LikeResponse

func LikeResponse(postID string) Like

type Me

type Me struct {
	Data struct {
		Me struct {
			ID              string `json:"id"`
			Username        string `json:"username"`
			Name            string `json:"name"`
			FollowersCount  int    `json:"followersCount"`
			FollowingsCount int    `json:"followingsCount"`
			NewPost         struct {
				Nodes []struct {
					Title string `json:"title"`
					URL   string `json:"url"`
				} `json:"nodes"`
			} `json:"newPost"`
			OldPost struct {
				Nodes []struct {
					Title string `json:"title"`
					URL   string `json:"url"`
				} `json:"nodes"`
			} `json:"oldPost"`
			Publications struct {
				Edges []struct {
					Node struct {
						ID    string `json:"id"`
						Title string `json:"title"`
					} `json:"node"`
				} `json:"edges"`
			} `json:"publications"`
		} `json:"me"`
	} `json:"data"`
	Errors []utils.Error `json:"errors"`
}

func MeResponse

func MeResponse() Me

type Post

type Post struct {
	Data struct {
		Post utils.Post `json:"post"`
	} `json:"data"`
	Errors []utils.Error `json:"errors"`
}

func PostResponse

func PostResponse(postID string) Post

type Publish

type Publish struct {
	Data struct {
		PublishPost struct {
			Post struct {
				Id string `json:"id"`
			} `json:"post"`
		} `json:"publishPost"`
	} `json:"data"`
	Errors []utils.Error `json:"errors"`
}

func PublishResponse

func PublishResponse(title, content, coverImg, publicationId string, tags []string) Publish
type Search struct {
	Hits []struct {
		Id          string `json:"objectID"`
		Title       string `json:"title"`
		Brief       string `json:"brief"`
		PublishedAt string `json:"dateAdded"`
		Author      string `json:"authorName"`
	} `json:"hits"`
}

func SearchResponse

func SearchResponse(r chan struct{}, query string) Search

Jump to

Keyboard shortcuts

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