events

package
v1.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidTransports

func ValidTransports() []string

func ValidTriggers

func ValidTriggers() []string

Types

type MockEvent added in v0.3.2

type MockEvent interface {
	// Returns the Mock Response for the given transport
	GenerateEvent(p MockEventParameters) (MockEventResponse, error)

	// Returns the trigger for the event (e.g. cheer for cheer events, or add-reward for channel points add rewards)
	ValidTrigger(trigger string) bool

	// Returns whether a given event supports a supplied transport
	ValidTransport(transport string) bool

	// Returns the string of the topic
	GetTopic(transport string, trigger string) string

	// Returns back the correct "trigger" if using the eventsub topic
	GetEventSubAlias(trigger string) string

	// Returns the subscription version for this event
	SubscriptionVersion() string
}

MockEvent represents an event to be triggered using the `twitch event trigger <event>` command.

type MockEventParameters added in v0.3.2

type MockEventParameters struct {
	ID           string
	Transport    string
	Trigger      string
	FromUserID   string
	FromUserName string
	ToUserID     string
	ToUserName   string
	IsAnonymous  bool
	IsGift       bool
	Status       string
	ItemID       string
	ItemName     string
	Cost         int64
	IsPermanent  bool
	Description  string
	GameID       string
}

MockEventParameters are used to craft the event; most of this data is prepopulated by lower services, such as the from/to users to avoid replicating logic across files

type MockEventResponse added in v0.3.2

type MockEventResponse struct {
	ID        string
	JSON      []byte
	FromUser  string
	ToUser    string
	Timestamp string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL