record

package
v0.0.0-...-45628e0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package record is an interface to record League of Legends games to a file using data from the spectator endpoint. Most if not all of the methods here will return *RecordingError as the underlying error.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound        = errors.New("not found")
	ErrUnknownPlatform = errors.New("unknown platform")
)

Error variables to check what errors have occurred.

Functions

func GetPlatformVersion

func GetPlatformVersion(platform string) (string, error)

GetPlatformVersion returns the current version of the specified platform.

func IsValidPlatform

func IsValidPlatform(platform string) bool

IsValidPlatform returns whether or not a platform is valid (i.e. has an entry in the map of platforms and platform URLs).

func Record

func Record(platform, gameID, encryptionKey string,
	rec *recording.Recording) error

Record starts a new recording that writes into a *recording.Recording and blocks until the recording ends or an error occurs. Note that partial data may be written to the recording, even if the recording was unsuccessful. This partial data can probably be played back. ErrNotFound enclosed in a *RecordingError is returned if there is no game that can be recorded from the provided parameters.

Types

type RecordingError

type RecordingError struct {
	OpStack []string
	Err     error
}

RecordingError is the error container most, if not all, errors from the methods in the record package will return.

func (*RecordingError) Error

func (r *RecordingError) Error() string

Error formats the error with its stack into a string.

Jump to

Keyboard shortcuts

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