server

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientIP added in v0.3.2

func ClientIP(ctx context.Context) (string, bool)

ClientIP gets the http address server from context

func Endpoint added in v0.3.2

func Endpoint(ctx context.Context) (string, bool)

Endpoint gets the http address server from context

func ID added in v0.3.2

func ID(ctx context.Context) (string, bool)

ID gets the name server from context

func XForwardedFor added in v0.3.2

func XForwardedFor(ctx context.Context) (string, bool)

XForwardedFor gets the http address server from context

func XForwardedProto added in v0.3.2

func XForwardedProto(ctx context.Context) (string, bool)

XForwardedProto gets the http address server from context

Types

type Server

type Server interface {
	Router() http.Handler
	FetchGophers(w http.ResponseWriter, r *http.Request)
	FetchGopher(w http.ResponseWriter, r *http.Request)
	AddGopher(w http.ResponseWriter, r *http.Request)
	ModifyGopher(w http.ResponseWriter, r *http.Request)
	RemoveGopher(w http.ResponseWriter, r *http.Request)
}

Server representation of gopher server

func New

func New(
	serverID string,
	tracer *zipkin.Tracer,
	fS fetching.Service,
	aS adding.Service,
	mS modifying.Service,
	rS removing.Service,
) Server

New initialize the server

Jump to

Keyboard shortcuts

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