model

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostStatusDraft   = "draft"
	PostStatusPending = "pending"
	PostStatusPrivate = "private"
	PostStatusPublish = "publish"
	PostStatusTrash   = "trash"

	PostTypePost = "post"
	PostTypePage = "page"

	CommentStatusOpen   = "open"
	CommentStatusClosed = "closed"

	CommentStatusApproved   = "approved"
	CommentStatusUnapproved = "unapproved"

	PingStatusOpen   = "open"
	PingStatusClosed = "closed"

	PostFormatStandard = "standard"
	PostFormatAside    = "aside"
	PostFormatGallery  = "gallery"
	PostFormatImage    = "image"
	PostFormatLink     = "link"
	PostFormatStatus   = "status"
	PostFormatQuote    = "quote"
	PostFormatVideo    = "video"
	PostFormatChat     = "chat"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AvatarURLS

type AvatarURLS struct {
	Size24 string `json:"24,omitempty"`
	Size48 string `json:"48,omitempty"`
	Size96 string `json:"96,omitempty"`
}

type Category

type Category struct {
	ID          int         `json:"id,omitempty"`
	Count       int         `json:"count,omitempty"`       // Number of published posts for the term.
	Description string      `json:"description,omitempty"` // HTML description of the term.
	Link        string      `json:"link,omitempty"`        // URL of the term.
	Name        string      `json:"name,omitempty"`        // HTML title for the term.
	Slug        string      `json:"slug,omitempty"`        // An alphanumeric identifier for the term unique to its type.
	Taxonomy    string      `json:"taxonomy,omitempty"`    // One of: category, post_tag, nav_menu, link_category, post_format. Type attribution for the term.
	Parent      int         `json:"parent,omitempty"`      // The parent term ID.
	Meta        interface{} `json:"meta,omitempty"`        // Meta fields.
}

func (*Category) Map

func (instance *Category) Map() map[string]interface{}

func (*Category) String

func (instance *Category) String() string

type CategoryQueryParams

type CategoryQueryParams struct {
	Context string `json:"context,omitempty"`  // One of: view, embed, edit. Scope under which the request is made; determines fields present in response.
	Page    int    `json:"page,omitempty"`     // Current page of the collection.
	PerPage int    `json:"per_page,omitempty"` // Default: 10. Maximum number of items to be returned in result set.
	Search  string `json:"search,omitempty"`   // Limit results to those matching a string.
	Exclude string `json:"exclude,omitempty"`  // Ensure result set excludes specific IDs.
	Include string `json:"include,omitempty"`  // Limit result set to specific IDs.
	Order   string `json:"order,omitempty"`    // Default: desc. One of: asc, desc. Order sort attribute ascending or descending.
	OrderBy string `json:"order_by,omitempty"` // Default: date. One of: author, date, id, include, modified, parent, relevance, slug, include_slugs, title. Sort collection by object attribute.
	Parent  int    `json:"parent,omitempty"`   // Limit result set to terms assigned to a specific parent.
	Post    int    `json:"post,omitempty"`     // Limit result set to terms assigned to a specific post.
	Slug    string `json:"slug,omitempty"`     // Limit result set to posts with one or more specific slugs.
}

func (*CategoryQueryParams) Map

func (instance *CategoryQueryParams) Map() map[string]interface{}

func (*CategoryQueryParams) String

func (instance *CategoryQueryParams) String() string

type Comment

type Comment struct {
	ID              int        `json:"id,omitempty"`
	AvatarURL       string     `json:"avatar_url,omitempty"`
	AvatarURLs      AvatarURLS `json:"avatar_urls,omitempty"`
	Author          int        `json:"author,omitempty"`
	AuthorEmail     string     `json:"author_email,omitempty"`
	AuthorIP        string     `json:"author_ip,omitempty"`
	AuthorName      string     `json:"author_name,omitempty"`
	AuthorURL       string     `json:"author_url,omitempty"`
	AuthorUserAgent string     `json:"author_user_agent,omitempty"`
	Content         Content    `json:"content,omitempty"`
	Date            string     `json:"date,omitempty"`
	DateGMT         string     `json:"date_gmt,omitempty"`
	Karma           int        `json:"karma,omitempty"`
	Link            string     `json:"link,omitempty"`
	Parent          int        `json:"parent,omitempty"`
	Post            int        `json:"post,omitempty"`
	Status          string     `json:"status,omitempty"`
	Type            string     `json:"type,omitempty"`
}

type Content

type Content struct {
	Raw      string `json:"raw,omitempty"`
	Rendered string `json:"rendered,omitempty"`
}

type Excerpt

type Excerpt struct {
	Raw      string `json:"raw,omitempty"`
	Rendered string `json:"rendered,omitempty"`
}

type GUID

type GUID struct {
	Raw      string `json:"raw,omitempty"`
	Rendered string `json:"rendered,omitempty"`
}

type Media

type Media struct {
	ID           int              `json:"id,omitempty"`
	Date         string           `json:"date,omitempty"`
	DateGMT      string           `json:"date_gmt,omitempty"`
	GUID         GUID             `json:"guid,omitempty"`
	Link         string           `json:"link,omitempty"`
	Modified     string           `json:"modified,omitempty"`
	ModifiedGMT  string           `json:"modifiedGMT,omitempty"`
	Password     string           `json:"password,omitempty"`
	Slug         string           `json:"slug,omitempty"`
	Status       string           `json:"status,omitempty"`
	Type         string           `json:"type,omitempty"`
	Title        Title            `json:"title,omitempty"`
	Author       int              `json:"author,omitempty"`
	MediaStatus  string           `json:"comment_status,omitempty"`
	PingStatus   string           `json:"ping_status,omitempty"`
	AltText      string           `json:"alt_text,omitempty"`
	Caption      MediaCaption     `json:"caption,omitempty"`
	Description  MediaDescription `json:"description,omitempty"`
	MediaType    string           `json:"media_type,omitempty"`
	MediaDetails MediaDetails     `json:"media_details,omitempty"`
	Post         int              `json:"post,omitempty"`
	SourceURL    string           `json:"source_url,omitempty"`
}

func (*Media) Map

func (instance *Media) Map() map[string]interface{}

func (*Media) String

func (instance *Media) String() string

type MediaCaption

type MediaCaption struct {
	Raw      string `json:"raw,omitempty"`
	Rendered string `json:"rendered,omitempty"`
}

type MediaDescription

type MediaDescription struct {
	Raw      string `json:"raw,omitempty"`
	Rendered string `json:"rendered,omitempty"`
}

type MediaDetails

type MediaDetails struct {
	Raw       string                 `json:"raw,omitempty"`
	Rendered  string                 `json:"rendered,omitempty"`
	Width     int                    `json:"width,omitempty"`
	Height    int                    `json:"height,omitempty"`
	File      string                 `json:"file,omitempty"`
	Sizes     MediaDetailsSizes      `json:"sizes,omitempty"`
	ImageMeta map[string]interface{} `json:"image_meta,omitempty"`
}

type MediaDetailsSizes

type MediaDetailsSizes struct {
	Thumbnail MediaDetailsSizesItem `json:"thumbnail,omitempty"`
	Medium    MediaDetailsSizesItem `json:"medium,omitempty"`
	Large     MediaDetailsSizesItem `json:"large,omitempty"`
}

type MediaDetailsSizesItem

type MediaDetailsSizesItem struct {
	File      string `json:"file,omitempty"`
	Width     int    `json:"width,omitempty"`
	Height    int    `json:"height,omitempty"`
	MimeType  string `json:"mime_type,omitempty"`
	SourceURL string `json:"source_url,omitempty"`
}

type MediaUploadOptions

type MediaUploadOptions struct {
	Filename    string
	ContentType string
	Data        []byte // source data
	Source      string // source file
}

type Meta

type Meta struct {
	ID    int    `json:"id,omitempty"`
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type MetaDeletedResponse

type MetaDeletedResponse struct {
	Message string `json:"message,omitempty"`
}

type Page

type Page struct {
	ID            int     `json:"id,omitempty"`
	Date          string  `json:"date,omitempty"`
	DateGMT       string  `json:"date_gmt,omitempty"`
	GUID          GUID    `json:"guid,omitempty"`
	Link          string  `json:"link,omitempty"`
	Modified      string  `json:"modified,omitempty"`
	ModifiedGMT   string  `json:"modifiedGMT,omitempty"`
	Password      string  `json:"password,omitempty"`
	Slug          string  `json:"slug,omitempty"`
	Status        string  `json:"status,omitempty"`
	Type          string  `json:"type,omitempty"`
	Parent        int     `json:"parent,omitempty"`
	Title         Title   `json:"title,omitempty"`
	Content       Content `json:"content,omitempty"`
	Author        int     `json:"author,omitempty"`
	Excerpt       Excerpt `json:"excerpt,omitempty"`
	FeaturedImage int     `json:"featured_image,omitempty"`
	CommentStatus string  `json:"comment_status,omitempty"`
	PingStatus    string  `json:"ping_status,omitempty"`
	MenuOrder     int     `json:"menu_order,omitempty"`
	Template      string  `json:"template,omitempty"`
}

type Post

type Post struct {
	ID            int           `json:"id,omitempty"`
	Date          string        `json:"date,omitempty"`     // The date the object was published, in the site's timezone.
	DateGMT       string        `json:"date_gmt,omitempty"` // The date the object was published, as GMT.
	GUID          GUID          `json:"guid,omitempty"`
	Link          string        `json:"link,omitempty"`
	Modified      string        `json:"modified,omitempty"`
	ModifiedGMT   string        `json:"modifiedGMT,omitempty"`
	Password      string        `json:"password,omitempty"` // A password to protect access to the content and excerpt.
	Slug          string        `json:"slug,omitempty"`     // An alphanumeric identifier for the object unique to its type.
	Status        string        `json:"status,omitempty"`   // One of: publish, future, draft, pending, private. A named status for the object.
	Type          string        `json:"type,omitempty"`
	Title         Title         `json:"title,omitempty"`          // The title for the object.
	Content       Content       `json:"content,omitempty"`        // The content for the object.
	Author        int           `json:"author,omitempty"`         // The ID for the author of the object.
	Excerpt       Excerpt       `json:"excerpt,omitempty"`        // The excerpt for the object.
	FeaturedMedia int           `json:"featured_media,omitempty"` // The ID of the featured media for the object.
	CommentStatus string        `json:"comment_status,omitempty"` // One of: open, closed. Whether or not comments are open on the object.
	PingStatus    string        `json:"ping_status,omitempty"`    // One of: open, closed. Whether or not the object can be pinged.
	Format        string        `json:"format,omitempty"`         // One of: standard, aside, chat, gallery, link, image, quote, status, video, audio. The format for the object.
	Sticky        bool          `json:"sticky,omitempty"`         // Whether or not the object should be treated as sticky.
	Template      string        `json:"template,omitempty"`       // The theme file to use to display the object.
	Categories    []interface{} `json:"categories,omitempty"`     // The terms assigned to the object in the category taxonomy.
	Tags          []interface{} `json:"tags,omitempty"`           // The terms assigned to the object in the post_tag taxonomy.
	Meta          []interface{} `json:"meta,omitempty"`           // Meta fields
}

func (*Post) Map

func (instance *Post) Map() map[string]interface{}

func (*Post) String

func (instance *Post) String() string

type PostQueryParams

type PostQueryParams struct {
	Context           string `json:"context,omitempty"`            // One of: view, embed, edit. Scope under which the request is made; determines fields present in response.
	Page              int    `json:"page,omitempty"`               // Current page of the collection.
	PerPage           int    `json:"per_page,omitempty"`           // Default: 10. Maximum number of items to be returned in result set.
	Search            string `json:"search,omitempty"`             // Limit results to those matching a string.
	After             string `json:"after,omitempty"`              // Limit response to posts published after a given ISO8601 compliant date.
	Author            string `json:"author,omitempty"`             // Limit result set to posts assigned to specific authors.
	AuthorExclude     string `json:"author_exclude,omitempty"`     // Ensure result set excludes posts assigned to specific authors.
	Before            string `json:"before,omitempty"`             // Limit response to posts published before a given ISO8601 compliant date.
	Exclude           string `json:"exclude,omitempty"`            // Ensure result set excludes specific IDs.
	Include           string `json:"include,omitempty"`            // Limit result set to specific IDs.
	Offset            int    `json:"offset,omitempty"`             // Offset the result set by a specific number of items.
	Order             string `json:"order,omitempty"`              // Default: desc. One of: asc, desc. Order sort attribute ascending or descending.
	OrderBy           string `json:"order_by,omitempty"`           // Default: date. One of: author, date, id, include, modified, parent, relevance, slug, include_slugs, title. Sort collection by object attribute.
	Slug              string `json:"slug,omitempty"`               // Limit result set to posts with one or more specific slugs.
	Status            string `json:"status,omitempty"`             // Default: publish. Limit result set to posts assigned one or more statuses.
	TaxRelation       string `json:"tax_relation,omitempty"`       // One of: AND, OR Limit result set based on relationship between multiple taxonomies.
	Categories        string `json:"categories,omitempty"`         // Limit result set to all items that have the specified term assigned in the categories taxonomy.
	CategoriesExclude string `json:"categories_exclude,omitempty"` // Limit result set to all items except those that have the specified term assigned in the categories taxonomy.
	Tags              string `json:"tags,omitempty"`               // Limit result set to all items that have the specified term assigned in the tags taxonomy.
	TagsExclude       string `json:"tags_exclude,omitempty"`       // Limit result set to all items except those that have the specified term assigned in the tags taxonomy.
	Sticky            bool   `json:"sticky,omitempty"`             // Limit result set to items that are sticky.
}

PostQueryParams https://developer.wordpress.org/rest-api/reference/posts/#list-posts

func (*PostQueryParams) Map

func (instance *PostQueryParams) Map() map[string]interface{}

func (*PostQueryParams) String

func (instance *PostQueryParams) String() string

type PostsTerm

type PostsTerm struct {
	ID          int    `json:"id,omitempty"`
	Count       int    `json:"integer,omitempty"`
	Description string `json:"description,omitempty"`
	Link        string `json:"link,omitempty"`
	Name        string `json:"name"`
	Slug        string `json:"slug,omitempty"`
	Taxonomy    string `json:"taxonomy,omitempty"`
	Parent      int    `json:"parent,omitempty"`
}

type Revision

type Revision struct {
	ID          int    `json:"id,omitempty"`
	Author      string `json:"author,omitempty"`
	Date        string `json:"date,omitempty"`
	DateGMT     string `json:"dateGMT,omitempty"`
	GUID        string `json:"guid,omitempty"`
	Modified    string `json:"modified,omitempty"`
	ModifiedGMT string `json:"modifiedGMT,omitempty"`
	Parent      int    `json:"parent,omitempty"`
	Slug        string `json:"slug,omitempty"`
	Title       string `json:"title,omitempty"`
	Content     string `json:"content,omitempty"`
	Excerpt     string `json:"excerpt,omitempty"`
}

type Tag

type Tag struct {
	ID          int         `json:"id,omitempty"`
	Count       int         `json:"count,omitempty"`       // Number of published posts for the term.
	Description string      `json:"description,omitempty"` // HTML description of the term.
	Link        string      `json:"link,omitempty"`        // URL of the term.
	Name        string      `json:"name,omitempty"`        // HTML title for the term.
	Slug        string      `json:"slug,omitempty"`        // An alphanumeric identifier for the term unique to its type.
	Taxonomy    string      `json:"taxonomy,omitempty"`    // One of: category, post_tag, nav_menu, link_category, post_format. Type attribution for the term.
	Meta        interface{} `json:"meta,omitempty"`        // Meta fields.
}

func (*Tag) Map

func (instance *Tag) Map() map[string]interface{}

func (*Tag) String

func (instance *Tag) String() string

type TagQueryParams

type TagQueryParams struct {
	Context   string `json:"context,omitempty"`    // One of: view, embed, edit. Scope under which the request is made; determines fields present in response.
	Page      int    `json:"page,omitempty"`       // Current page of the collection.
	PerPage   int    `json:"per_page,omitempty"`   // Default: 10. Maximum number of items to be returned in result set.
	Search    string `json:"search,omitempty"`     // Limit results to those matching a string.
	Exclude   string `json:"exclude,omitempty"`    // Ensure result set excludes specific IDs.
	Include   string `json:"include,omitempty"`    // Limit result set to specific IDs.
	Offset    string `json:"offset,omitempty"`     // Offset the result set by a specific number of items.
	Order     string `json:"order,omitempty"`      // Default: desc. One of: asc, desc. Order sort attribute ascending or descending.
	OrderBy   string `json:"order_by,omitempty"`   // Default: date. One of: author, date, id, include, modified, parent, relevance, slug, include_slugs, title. Sort collection by object attribute.
	HideEmpty bool   `json:"hide_empty,omitempty"` // Whether to hide terms not assigned to any posts.
	Post      int    `json:"post,omitempty"`       // Limit result set to terms assigned to a specific post.
	Slug      string `json:"slug,omitempty"`       // Limit result set to posts with one or more specific slugs.
}

func (*TagQueryParams) Map

func (instance *TagQueryParams) Map() map[string]interface{}

func (*TagQueryParams) String

func (instance *TagQueryParams) String() string

type Title

type Title struct {
	Raw      string `json:"raw,omitempty"`
	Rendered string `json:"rendered,omitempty"`
}

type Type

type Type struct {
	Description  string     `json:"description,omitempty"`
	Hierarchical bool       `json:"hierarchical,omitempty"`
	Name         string     `json:"name,omitempty"`
	Slug         string     `json:"slug,omitempty"`
	Labels       TypeLabels `json:"labels,omitempty"`
}

type TypeLabels

type TypeLabels struct {
	Name            string `json:"name,omitempty"`
	SingularName    string `json:"singular_name,omitempty"`
	AddNew          string `json:"add_new,omitempty"`
	AddNewItem      string `json:"add_new_item,omitempty"`
	EditItem        string `json:"edit_item,omitempty"`
	NewItem         string `json:"new_item,omitempty"`
	ViewItem        string `json:"view_item,omitempty"`
	SearchItems     string `json:"search_items,omitempty"`
	NotFound        string `json:"not_found,omitempty"`
	NotFoundInTrash string `json:"not_found_in_trash,omitempty"`
	ParentItemColon string `json:"parent_item_colon,omitempty"`
	AllItems        string `json:"all_items,omitempty"`
	MenuName        string `json:"menu_name,omitempty"`
	NameAdminBar    string `json:"name_admin_bar,omitempty"`
}

type Types

type Types struct {
	Post       Type `json:"post,omitempty"`
	Page       Type `json:"page,omitempty"`
	Attachment Type `json:"attachment,omitempty"`
}

type User

type User struct {
	ID                int                    `json:"id,omitempty"`
	AvatarURL         string                 `json:"avatar_url,omitempty"`
	AvatarURLs        AvatarURLS             `json:"avatar_urls,omitempty"`
	Capabilities      map[string]interface{} `json:"capabilities,omitempty"`
	Description       string                 `json:"description,omitempty"`
	Email             string                 `json:"email,omitempty"`
	ExtraCapabilities map[string]interface{} `json:"extra_capabilities,omitempty"`
	FirstName         string                 `json:"first_name,omitempty"`
	LastName          string                 `json:"last_name,omitempty"`
	Link              string                 `json:"link,omitempty"`
	Name              string                 `json:"name,omitempty"`
	Nickname          string                 `json:"nickname,omitempty"`
	RegisteredDate    string                 `json:"registered_date,omitempty"`
	Roles             []string               `json:"roles,omitempty"`
	Slug              string                 `json:"slug,omitempty"`
	URL               string                 `json:"url,omitempty"`
	Username          string                 `json:"username,omitempty"`
	Password          string                 `json:"password,omitempty"`
}

Jump to

Keyboard shortcuts

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