events

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 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
}

MockEvent represents an event to be triggered using the `twitch event trigger <event>` command. Given that both WebSub and EventSub need to be supported, it's required to have logic for both currently.

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
	Cost         int64
}

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