eventsource

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrNotImplemented ErrNotImplemented error
	ErrNotImplemented = errors.New("Browser not implemented Event Source")
	//ErrNotAnEventTarget ErrNotAnEventTarget error
	ErrNotAnEventSource = errors.New("Object is not an EventSource")
)

Functions

func GetInterface

func GetInterface() js.Value

GetJSInterface Get the Event Source Interface If nil browser doesn't implement it

Types

type EventSource

type EventSource struct {
	eventtarget.EventTarget
}

EventSource struct

func New

func New(url string, opts ...interface{}) (EventSource, error)

func NewFromJSObject

func NewFromJSObject(obj js.Value) (EventSource, error)

func (EventSource) Close

func (e EventSource) Close() error

func (EventSource) EventSource_

func (e EventSource) EventSource_() EventSource

func (EventSource) OnClose

func (e EventSource) OnClose(handler func(e event.Event)) (js.Func, error)

OnClose Set onClose Handler

func (EventSource) OnError

func (e EventSource) OnError(handler func(e event.Event)) (js.Func, error)

OnError Set onError Handler

func (EventSource) OnOpen

func (e EventSource) OnOpen(handler func(e event.Event)) (js.Func, error)

OnOpen Set onOpen Handler

func (EventSource) ReadyState

func (e EventSource) ReadyState() (int, error)

func (EventSource) SetOnClose

func (sse EventSource) SetOnClose(handler func(e event.Event))

SetOnClose Set onClose Handler

func (EventSource) SetOnError

func (sse EventSource) SetOnError(handler func(e event.Event))

SetOnClose Set onClose Handler

func (EventSource) SetOnMessage

func (sse EventSource) SetOnMessage(handler func(e messageevent.MessageEvent))

SetOnClose Set onClose Handler

func (EventSource) SetOnOpen

func (sse EventSource) SetOnOpen(handler func(e event.Event))

SetOnOpen Set onOpen Handler

func (EventSource) Url

func (e EventSource) Url() (string, error)

func (EventSource) WithCredentials

func (e EventSource) WithCredentials() (bool, error)

type EventSourceFrom

type EventSourceFrom interface {
	EventSource_() EventSource
}

Jump to

Keyboard shortcuts

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