Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
Context EventContext
Data json.RawMessage
}
Event is the basic data structure passed to functions by non-HTTP triggers.
func (*Event) PubSubMessage ¶
func (e *Event) PubSubMessage() (*PubSubMessage, error)
PubSubMessage unmarshals the event data as a pub sub message.
func (*Event) StorageObject ¶
func (e *Event) StorageObject() (*StorageObject, error)
StorageObject unmarshals the event data as a storage event.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON parses a JSON string to time.Time.
type EventContext ¶
type EventContext struct {
EventID string `json:"eventId"`
Timestamp JSTime `json:"timestamp"`
EventType string `json:"eventType"`
Resource string `json:"resource"`
}
EventContext holds the data associated with the event that triggered the execution of the function along with metadata of the event itself.
type JSTime ¶
JSTime is a wrapper for time.Time to decode the time from Javascript.
func (*JSTime) UnmarshalJSON ¶
UnmarshalJSON parses a JSON string to time.Time.
type PubSubMessage ¶
type PubSubMessage struct {
pubsub.PubsubMessage
Data []byte
}
PubSubMessage is a wrapper for pubsub.PubsubMessage.
type StorageObject ¶
StorageObject is a wrapper for storage.Object.
Click to show internal directories.
Click to hide internal directories.