Documentation ¶
Index ¶
- Constants
- type WpConnection
- func (instance *WpConnection) Delete(url string, body interface{}) (response []byte, err error)
- func (instance *WpConnection) Get(url string) (response []byte, err error)
- func (instance *WpConnection) IsEnabled() bool
- func (instance *WpConnection) Post(url string, body interface{}) (response []byte, err error)
- func (instance *WpConnection) Settings() (response *WpSettings)
- func (instance *WpConnection) Upload(url string, filePath string) (response []byte, err error)
- type WpSettings
Constants ¶
View Source
const ( RouteUsers = "users" RoutePosts = "posts" RouteCategories = "categories" RouteTags = "tags" RoutePages = "pages" RouteMedia = "media" RouteMeta = "meta" RouteRevisions = "revisions" RouteComments = "comments" RouteTaxonomies = "taxonomies" RouteTerms = "terms" RouteStatuses = "statuses" RouteTypes = "types" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WpConnection ¶
type WpConnection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(args ...interface{}) (instance *WpConnection, err error)
func (*WpConnection) Delete ¶
func (instance *WpConnection) Delete(url string, body interface{}) (response []byte, err error)
func (*WpConnection) Get ¶
func (instance *WpConnection) Get(url string) (response []byte, err error)
func (*WpConnection) IsEnabled ¶
func (instance *WpConnection) IsEnabled() bool
func (*WpConnection) Post ¶
func (instance *WpConnection) Post(url string, body interface{}) (response []byte, err error)
func (*WpConnection) Settings ¶
func (instance *WpConnection) Settings() (response *WpSettings)
type WpSettings ¶
type WpSettings struct { ApiBaseUrl string `json:"api-base-url"` // example: `http://192.168.99.100:32777/wp-json/wp/v2` User string `json:"user"` Password string `json:"password"` DefaultStatus string `json:"def-status"` // One of: publish, future, draft, pending, private. DefaultFormat string `json:"def-format"` // One of: standard, aside, chat, gallery, link, image, quote, status, video, audio. DefaultCommentStatus string `json:"def-comment_status"` // One of: open, closed. DefaultPingStatus string `json:"def-ping_status"` // One of: open, closed. }
func (*WpSettings) Load ¶
func (instance *WpSettings) Load(m map[string]interface{}) (err error)
func (*WpSettings) Map ¶
func (instance *WpSettings) Map() (m map[string]interface{})
Click to show internal directories.
Click to hide internal directories.