server

package
v0.0.0-...-62f4897 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 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 Option

type Option func(*server) error

Option defines the interface to use to set options on the Server instance

func WithLogger

func WithLogger(l log.Logger) Option

WithLogger sets which logger instance the server should use

func WithSourceFiles

func WithSourceFiles(files []string) Option

WithSourceFiles sets up the server with some initial data source files. TODO: each time the server restarts it creates a new ID for the same datafile. This means clients will download the same files multiple times. We could instead use file hashes as IDs, but this might be inefficient for large data files. Alternatively, using filenames as IDs exposes implementation details to the clients of our server.

type Server

type Server interface {
	Serve(l net.Listener) error
	Shutdown()
}

Server is the public interface used to hide the implementation details of server.

func New

func New(opts ...Option) (Server, error)

New creates a new instance of a server using the given options

Jump to

Keyboard shortcuts

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