views

package
v0.0.0-...-11f3239 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	XMLName xml.Name `xml:"application"`
	Name    string   `xml:"name"`
	Live    Live     `xml:"live"`
}

Application is the endpoint section that streams can go to

type Config

type Config struct {
	Verbose               bool
	Version               string
	Forwarder             string `envconfig:"FORWARDER"`
	Recorder              string `envconfig:"RECORDER"`
	ForwarderUsername     string `envconfig:"FORWARDER_USERNAME"`
	RecorderUsername      string `envconfig:"RECORDER_USERNAME"`
	ForwarderPassword     string `envconfig:"FORWARDER_PASSWORD"`
	RecorderPassword      string `envconfig:"RECORDER_PASSWORD"`
	StreamServer          string `envconfig:"STREAM_SERVER"`
	TransmissionLight     string `envconfig:"TRANSMISSION_LIGHT"`
	KeyChecker            string `envconfig:"KEY_CHECKER"`
	ServerPort            int    `envconfig:"SERVER_PORT"`
	ServerAddress         string `envconfig:"SERVER_ADDRESS"`
	RecordingLocation     string `envconfig:"RECORDING_LOCATION"`
	StreamerWebsocketPath string `envconfig:"STREAMER_WEBSOCKET_PATH"`
	StreamerAdminPath     string `envconfig:"STREAMER_ADMIN_PATH"`
}

Config the global web-auth configuration

type ListedStream

type ListedStream struct {
	Code  string `json:"code"`
	Input string `json:"input"`
}

type Live

type Live struct {
	XMLName xml.Name `xml:"live"`
	Streams []Stream `xml:"stream"`
}

Live holds all the stream elements

type RTMP

type RTMP struct {
	XMLName xml.Name `xml:"rtmp"`
	Server  Server   `xml:"server"`
}

RTMP struct is the parent rtmp xml body

type RecallStream

type RecallStream struct {
	StreamServer string `json:"streamServer"`
	StreamKey    string `json:"streamKey"`
}

type ResumeResponse

type ResumeResponse struct {
	Response  string `json:"response"`
	Error     string `json:"error"`
	Website   bool   `json:"website"`
	Recording bool   `json:"recording"`
	Streams   uint64 `json:"streams"`
}

type Server

type Server struct {
	XMLName      xml.Name      `xml:"server"`
	Applications []Application `xml:"application"`
}

Server holds all the applications that will accept streams

type StartSaveValidationResponse

type StartSaveValidationResponse struct {
	Input           string
	RecordCheckbox  bool
	SavePath        string
	WebsiteCheckbox bool
	WebsiteOut      string
	Streams         []string
	Error           error
}

type StartingType

type StartingType int

StartingType identifies which starting type this should act as

type StatusResponse

type StatusResponse struct {
	Status []StatusResponseIndividual `json:"status"`
	Error  string                     `json:"error"`
}

type StatusResponseIndividual

type StatusResponseIndividual struct {
	Name     string `json:"name"`
	Response string `json:"response"`
	Error    string `json:"error"`
}

type Stream

type Stream struct {
	XMLName xml.Name `xml:"stream"`
	Name    string   `xml:"name"`
}

Stream is the individual stream element

type TransporterRouter

type TransporterRouter struct {
	// ReturningChannel is the channel for returning data on
	ReturningChannel chan []byte
	// TransporterUnique is the payload to send to the client
	TransporterUnique transporter.TransporterUnique
}

type ValidationType

type ValidationType int

ValidationType is used to determine how a form input should be validated

type Views

type Views struct {
	// contains filtered or unexported fields
}

Views encapsulates our view dependencies

func New

func New(conf Config, store *store.Store) *Views

New initialises connections, templates, and cookies

func (*Views) ActiveStreamCheck

func (v *Views) ActiveStreamCheck() bool

ActiveStreamCheck checks if there are any existing streams still registered in the database

func (*Views) ActiveStreamsFunc

func (v *Views) ActiveStreamsFunc(c echo.Context) error

func (*Views) BeginWatchdog

func (v *Views) BeginWatchdog()

func (*Views) CustomHTTPErrorHandler

func (v *Views) CustomHTTPErrorHandler(err error, c echo.Context)

func (*Views) DeleteFunc

func (v *Views) DeleteFunc(c echo.Context) error

DeleteFunc will delete the saved stream before it can start

func (*Views) EndpointsFunc

func (v *Views) EndpointsFunc(c echo.Context) error

EndpointsFunc presents the endpoints to the user

func (*Views) Error404

func (v *Views) Error404(c echo.Context) error

func (*Views) ExistingStreamCheck

func (v *Views) ExistingStreamCheck() bool

ExistingStreamCheck checks if there are any existing streams still registered in the database

func (*Views) FacebookHelpFunc

func (v *Views) FacebookHelpFunc(c echo.Context) error

FacebookHelpFunc is the handler for the Facebook help page

func (*Views) ForceRemoveFunc

func (v *Views) ForceRemoveFunc(c echo.Context) error

func (*Views) HandleTXLight

func (v *Views) HandleTXLight(url string, function tx.FunctionTX) error

func (*Views) HomeFunc

func (v *Views) HomeFunc(c echo.Context) error

HomeFunc is the basic html writer that provides the main page for Streamer

func (*Views) ListFunc

func (v *Views) ListFunc(c echo.Context) error

ListFunc lists all current streams that are registered in the database

func (*Views) RecallFunc

func (v *Views) RecallFunc(c echo.Context) error

RecallFunc can pull back up stream details from the save function and allows you to start a stored stream

func (*Views) ResumeFunc

func (v *Views) ResumeFunc(c echo.Context) error

ResumeFunc is used if the user decides to return at a later date then they can, by inputting the unique code that they were given then they can go to the resume page and enter the code

func (*Views) SaveFunc

func (v *Views) SaveFunc(c echo.Context) error

SaveFunc allows for the functionality of saving a stream's details for later in order to make things easier for massive operations where you have multiple streams at once

func (*Views) SavedStreamCheck

func (v *Views) SavedStreamCheck() bool

SavedStreamCheck checks if there are any existing streams still registered in the database

func (*Views) ServerErrorFunc

func (v *Views) ServerErrorFunc(c echo.Context) error

func (*Views) StartFunc

func (v *Views) StartFunc(c echo.Context) error

StartFunc is the core of the program, where it takes the values set by the user in the webpage and processes the data and sends it to the recorder and the forwarder

func (*Views) StartUniqueFunc

func (v *Views) StartUniqueFunc(c echo.Context) error

StartUniqueFunc is the core of the program, where it takes the values set by the user in the webpage and processes the data and sends it to the recorder and the forwarder with a specified unique key

func (*Views) StatusFunc

func (v *Views) StatusFunc(c echo.Context) error

StatusFunc is used to check the status of the streams and does this by tail command of the output logs

func (*Views) StopFunc

func (v *Views) StopFunc(c echo.Context) error

StopFunc is used when the stream is finished, then you can stop the stream by pressing the stop button, and that would kill all the ffmpeg commands

func (*Views) StreamsFunc

func (v *Views) StreamsFunc(c echo.Context) error

StreamsFunc collects the data from the rtmp stat page of nginx and produces a list of active streaming endpoints from given endpoints

func (*Views) Websocket

func (v *Views) Websocket(c echo.Context) error

func (*Views) YoutubeHelpFunc

func (v *Views) YoutubeHelpFunc(c echo.Context) error

YoutubeHelpFunc is the handler for the YouTube help page

Jump to

Keyboard shortcuts

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