app

package
v0.0.0-...-a8fe441 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(config *Config) *App

func (*App) Start

func (app *App) Start()

func (*App) Stop

func (app *App) Stop()

type Clock

type Clock interface {
	Now() int64
}

type Config

type Config struct {
	Host string
	Port int
}

func NewConfig

func NewConfig() *Config

func (*Config) Addr

func (c *Config) Addr() string

type DefaultClock

type DefaultClock struct {
	Clock
}

func (*DefaultClock) Now

func (c *DefaultClock) Now() int64

type Message

type Message struct {
	Id               int    `json:"id"`
	TimestampSeconds int64  `json:"timestampSeconds"`
	UserName         string `json:"userName"`
	Body             string `json:"body"`
}

type Server

type Server struct {
	Clock Clock
	// contains filtered or unexported fields
}

func NewChatServer

func NewChatServer() *Server

func (*Server) Handler

func (s *Server) Handler() http.Handler

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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