Documentation
¶
Index ¶
Constants ¶
Variables ¶
View Source
var (
ErrEventNotAllowed = errors.New("event not allowed")
)
Functions ¶
This section is empty.
Types ¶
type EventContainerStart ¶
type EventContainerStart struct {
ProxyUID string `json:"proxyUid"`
}
func (EventContainerStart) EventType ¶
func (event EventContainerStart) EventType() string
type EventContainerStop ¶
type EventContainerStop struct {
ProxyUID string `json:"proxyUid"`
}
func (EventContainerStop) EventType ¶
func (event EventContainerStop) EventType() string
type EventError ¶
func (EventError) EventType ¶
func (event EventError) EventType() string
type EventLog ¶
type EventLog struct { EventType string `json:"eventType"` Timestamp time.Time `json:"timestamp"` Event Event `json:"event"` }
EventLog is the struct that will be send to the Webhook.URL
type EventPlayerJoin ¶
type EventPlayerJoin struct { Username string `json:"username"` RemoteAddress string `json:"remoteAddress"` TargetAddress string `json:"targetAddress"` ProxyUID string `json:"proxyUid"` }
func (EventPlayerJoin) EventType ¶
func (event EventPlayerJoin) EventType() string
type EventPlayerLeave ¶
type EventPlayerLeave struct { Username string `json:"username"` RemoteAddress string `json:"remoteAddress"` TargetAddress string `json:"targetAddress"` ProxyUID string `json:"proxyUid"` }
func (EventPlayerLeave) EventType ¶
func (event EventPlayerLeave) EventType() string
type HTTPClient ¶
HTTPClient represents an interface for the Webhook to send events with.
type Webhook ¶
type Webhook struct { ID string HTTPClient HTTPClient URL string EventTypes []string }
Webhook can send a Event via POST Request to a specified URL. There are two ways to use a Webhook. You can directly call DispatchEvent or Serve to attach a channel to the Webhook.
func (Webhook) DispatchEvent ¶
DispatchEvent wraps the given Event in an EventLog and marshals it into JSON before sending it in a POST Request to the Webhook.URL.
Click to show internal directories.
Click to hide internal directories.