Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface {
Execute(logger log.Logger, payload WebhookPayload) error
}
Action represents a type of thing to be done for a webhook payload
type Activity ¶
type Activity struct { ReceivedAt time.Time `json:"receivedAt"` RequestID string `json:"requestId"` Payload WebhookPayload `json:"payload"` ThumbPath string `json:"thumbPath,omitempty"` }
type Config ¶
type Config struct {
Triggers []Trigger `json:"triggers"`
}
Config represents a plexus config
type RawAction ¶
RawAction is the definition of a thing that should occur when a Trigger matches a Plex webhook
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is used to read/write data relevant to the application. I acknowledge that this may be an unnecessary abstraction.
func (*Store) AddActivity ¶
AddActivity appends the given Activity to the Store.
func (*Store) GetAllActivity ¶
GetAllActivity returns all Activity items in the Store
type Trigger ¶
type Trigger struct { Properties map[string]interface{} `json:"properties"` RawActions []RawAction `json:"actions"` ParsedActions []Action `json:"-"` }
Trigger is a configuration for tying a specific Plex webhook to a set of desired actions
type WebhookAction ¶
func (WebhookAction) Execute ¶
func (w WebhookAction) Execute(logger log.Logger, payload WebhookPayload) error
type WebhookPayload ¶
type WebhookPayload struct { Event string `json:"event"` User bool `json:"user"` Owner bool `json:"owner"` Account struct { ID int `json:"id"` Thumb string `json:"thumb"` Title string `json:"title"` } `json:"Account"` Server struct { Title string `json:"title"` UUID string `json:"uuid"` } `json:"Server"` Player struct { Local bool `json:"local"` PublicAddress string `json:"publicAddress"` Title string `json:"title"` UUID string `json:"uuid"` } `json:"Player"` Metadata struct { LibrarySectionType string `json:"librarySectionType"` RatingKey string `json:"ratingKey"` Key string `json:"key"` ParentRatingKey string `json:"parentRatingKey"` GrandparentRatingKey string `json:"grandparentRatingKey"` GUID string `json:"guid"` LibrarySectionID int `json:"librarySectionID"` Type string `json:"type"` Title string `json:"title"` GrandparentKey string `json:"grandparentKey"` ParentKey string `json:"parentKey"` GrandparentTitle string `json:"grandparentTitle"` ParentTitle string `json:"parentTitle"` Summary string `json:"summary"` Index int `json:"index"` ParentIndex int `json:"parentIndex"` RatingCount int `json:"ratingCount"` Thumb string `json:"thumb"` Art string `json:"art"` ParentThumb string `json:"parentThumb"` GrandparentThumb string `json:"grandparentThumb"` GrandparentArt string `json:"grandparentArt"` AddedAt int `json:"addedAt"` UpdatedAt int `json:"updatedAt"` } `json:"Metadata"` }
WebhookPayload represents a payload from a plex webhook
Click to show internal directories.
Click to hide internal directories.