Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type FailureMode ¶
type FailureMode int
const ( FailFast FailureMode = iota LogAndContinue Fallback DefaultFailureMode FailureMode = FailFast )
func ParseFailureMode ¶
func ParseFailureMode(s string) FailureMode
func (FailureMode) String ¶
func (f FailureMode) String() string
type HookData ¶ added in v1.8.4
type HookData struct {
ContentID int `json:"contentId"`
UserID int `json:"userId"`
Title string `json:"title"`
Content string `json:"content"`
Tags []string `json:"tags"`
Status string `json:"status"`
PostType string `json:"postType"`
CustomFields map[string]any `json:"customFields,omitempty"`
}
HookData is the JSON structure sent to and received from plugin hooks.
type HookName ¶
type HookName string
const ( HookBeforeSave HookName = "BeforeSaveContent" HookAfterPublish HookName = "AfterPublishContent" HookBeforeDelete HookName = "BeforeDeleteContent" HookAfterCreate HookName = "AfterCreateContent" HookAfterUnpublish HookName = "AfterUnpublishContent" HookOnPluginLoaded HookName = "OnPluginLoaded" DefaultPriority = 100 )
func ResolveWasmHookName ¶
type HookRegistration ¶
type HookRegistration struct {
PluginName string
HookName HookName
Priority int
Handler HookHandler
FailureMode FailureMode
FallbackHandler HookHandler
}
type HookResult ¶ added in v1.8.4
type HookResult struct {
Title *string `json:"title"`
CustomFields map[string]any `json:"customFields,omitempty"`
}
HookResult is the parse view of a before_save hook's returned JSON. Title is a pointer so an absent key (no change) is distinguishable from an explicit empty string (invalid, rejected by ValidateTitle).