server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PixelGifBytes

func PixelGifBytes() []byte

PixelGifBytes returns the content of the pixel gif in https://github.com/documentcloud/pixel-ping

Types

type HitServer

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

HitServer is the main struct for managing hitpoints

func NewHitServer

func NewHitServer() HitServer

NewHitServer creates a HitServer

func (*HitServer) HandleJS added in v0.3.0

func (s *HitServer) HandleJS(domain string, ssl bool) func(http.ResponseWriter, *http.Request)

HandleJS creates a handler function for the JS file used to count hits

func (*HitServer) HandlePixelRequest

func (s *HitServer) HandlePixelRequest(w http.ResponseWriter, r *http.Request)

HandlePixelRequest sends a message to the hits worker and returns the pixel GIF

func (*HitServer) StartWorker added in v0.2.0

func (s *HitServer) StartWorker(hitFunc func(string))

StartWorker begins accepting hits on the hits channel and caching them

Jump to

Keyboard shortcuts

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