events

package
v1.1.22 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 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

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
	GetAllTopicsByTransport(transport string) []string

	// 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
	GiftUser            string
	EventStatus         string
	SubscriptionStatus  string
	ItemID              string
	ItemName            string
	Cost                int64
	Description         string
	GameID              string
	Tier                string
	Timestamp           string
	CharityCurrentValue int
	CharityTargetValue  int
	ClientID            string
	BanStartTimestamp   string
	BanEndTimestamp     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