client

package
v0.0.4-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 27, 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 HandleWebsocketClose

func HandleWebsocketClose(connection *websocket.Conn)

func InitClient

func InitClient(input chan string) *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   string
	LogLevel zapcore.Level
}

func InitOptions

func InitOptions() *ClientOptions

type IdentityMessage

type IdentityMessage struct {
	PeerId string `json:"peerId"`
	Local  bool   `json:"local"`
}

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