state

package
v0.0.0-...-42ae80f Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	Conf *config.Conf

	CloseChan chan bool

	StreamsMutex sync.Mutex
	Streams      map[string]*Stream
}

func New

func New() *State

func (*State) GetStream

func (s *State) GetStream(name string) *Stream

func (*State) RemoveStream

func (s *State) RemoveStream(name string)

func (*State) SetStream

func (s *State) SetStream(name string, stream *Stream)

func (*State) Shutdown

func (s *State) Shutdown()

type Stream

type Stream struct {
	sync.Mutex
	Viewers   map[string]*Viewer
	StartTime time.Time
}

func NewStream

func NewStream() *Stream

func (*Stream) GetCurrentViewers

func (s *Stream) GetCurrentViewers(timeout time.Duration) int

func (*Stream) GetUptime

func (s *Stream) GetUptime() time.Duration

type Viewer

type Viewer struct {
	FirstSeen time.Time
	LastSeen  time.Time
	Ip        string
}

Jump to

Keyboard shortcuts

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