server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CONTENT_TYPE_FILE string = "application/octet-stream"
View Source
const CONTENT_TYPE_JSON string = "application/json"
View Source
const CONTENT_TYPE_TEXT string = "text/plain"
View Source
const CTX_NAME_KEY string = "ctx_name"
View Source
const DEFAULT_PORT int = 8883

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleServer

type SimpleServer struct {
	Port int
	Dir  string
	// contains filtered or unexported fields
}

Very simple http server which makes your file directory available via http.

Default port is 8883.

func (*SimpleServer) Start

func (s *SimpleServer) Start() (string, error)

Starts the http server and return its address.

func (*SimpleServer) Stop

func (simpleServer *SimpleServer) Stop() error

Stops the http server

Jump to

Keyboard shortcuts

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