client

package
v0.0.7-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_ENVIRONMENT = "prod"
	DEFAULT_DOMAIN      = "localhost:3000"
	DEFAULT_LOG_LEVEL   = "error"
)

Variables

This section is empty.

Functions

func HandleIncomingMessages

func HandleIncomingMessages(connection *websocket.Conn)

Needed to receive server events Right now we do nothing, but its here to avoid errors on the protocol

func HandleSendEvents

func HandleSendEvents(input chan string, connection *websocket.Conn)

func HandleWebsocketClose

func HandleWebsocketClose(connection *websocket.Conn)

func InitClient

func InitClient() *websocket.Conn

func Main

func Main()

func ScanFile

func ScanFile(input chan string)

func SendIdentity

func SendIdentity(connection *websocket.Conn, clientId string)

Types

type ClientOptions

type ClientOptions struct {
	Env      string
	Domain   *utils.Domain
	LogLevel zapcore.Level
	PeerId   string
	Listen   bool
}

func InitOptions

func InitOptions() *ClientOptions

type IdentityMessage

type IdentityMessage struct {
	PeerId      string `json:"peerId"`
	Broadcaster bool   `json:"broadcaster"`
	Subscriber  bool   `json:"subscriber"`
}

type LogMessage

type LogMessage struct {
	Line string `json:"line"`
}

type Message

type Message struct {
	Id      string      `json:"id"`
	Payload interface{} `json:"payload"`
	Event   string      `json:"event"`
}

func (Message) MarshalLogObject

func (message Message) MarshalLogObject(encoder zapcore.ObjectEncoder) error

Jump to

Keyboard shortcuts

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