core

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: MIT Imports: 19 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDirectoryNotCreated = errors.New("Could not create directory for URI")

ErrDirectoryNotCreated is sent when the system cannot create the directory for the URI

View Source
var ErrTimeout = errors.New("Timeout error")

ErrTimeout describes an error related to timing out

View Source
var ErrUnexpected = errors.New("Unexpected error")

ErrUnexpected describes an unexpected error

Functions

func SetupLogger

func SetupLogger(spec *config.Specification)

SetupLogger sets the logger for the proper settings based on the environment

Types

type Controller added in v1.1.0

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

Controller holds all handler functions for the API

func GetRouter

func GetRouter(config *config.Specification) (*httprouter.Router, *Controller)

GetRouter returns the return for the application

func NewController added in v1.1.0

func NewController(spec *config.Specification, fileServer http.Handler) *Controller

NewController creates a new instance of Controller

func (*Controller) ExitHandler added in v1.1.0

func (c *Controller) ExitHandler() chan bool

ExitHandler is a function that can recognise when the application is being closed and cleans up all background running processes

func (*Controller) FileHandler added in v1.1.0

func (c *Controller) FileHandler(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

FileHandler is HTTP handler for direct file requests

func (*Controller) ListStreamHandler added in v1.1.0

func (c *Controller) ListStreamHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

ListStreamHandler is the HTTP handler of the /list call

func (*Controller) SendError added in v1.1.0

func (c *Controller) SendError(w http.ResponseWriter, err error, status int)

SendError sends an error to the client

func (*Controller) StartStreamHandler added in v1.1.0

func (c *Controller) StartStreamHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

StartStreamHandler is an HTTP handler for the /start endpoint

type ErrDTO added in v1.1.0

type ErrDTO struct {
	Error string `json:"error"`
}

ErrDTO describes a DTO that has a message as an error

type IManager added in v1.1.0

type IManager interface {
	Start(cmd *exec.Cmd, physicalPath string) chan bool
}

IManager is the interface for the manager object that handles the start of the transcoding process

type Manager added in v1.1.0

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

Manager is describes a new object that has the start function

func NewManager added in v1.1.0

func NewManager(timeout time.Duration) *Manager

NewManager returns a new instance of a manager

func (Manager) Start added in v1.1.0

func (m Manager) Start(cmd *exec.Cmd, physicalPath string) chan bool

Start is to manage the start of the transcoding

type StreamDto added in v1.1.0

type StreamDto struct {
	URI string `json:"uri"`
}

StreamDto describes an uri where the client can access the stream

type SummariseDto added in v1.1.0

type SummariseDto struct {
	Running bool   `json:"running"`
	URI     string `json:"uri"`
}

SummariseDto describes each stream and their state of running

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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