http

package
v0.0.0-...-18d19a3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2018 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSession              = errors.New("no session in request")
	ErrBadSession             = errors.New("bad session")
	ErrSessionItemIsNotString = errors.New("session item is not string")
)

Functions

This section is empty.

Types

type CodeWriter

type CodeWriter struct {
	*sqlx.Tx

	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*CodeWriter) Write

func (c *CodeWriter) Write(resp []byte) (int, error)

func (*CodeWriter) WriteHeader

func (c *CodeWriter) WriteHeader(code int)

type EResult

type EResult struct {
	Result  interface{}                 `json:"result,omitempty"`
	Errors  map[string][]amalgam.AError `json:"errors,omitempty"`
	Success bool                        `json:"success"`
}

type HTTPService

type HTTPService interface {
	ProxyPass(path, dst string)
	Register(string, http.HandlerFunc)
	Reject(w http.ResponseWriter, reason map[string][]amalgam.AError)
	Respond(w http.ResponseWriter, result interface{})
	ListenAndServe(string)
	Redirect(w http.ResponseWriter, r *http.Request, url string, code int)
	GetUser(ctx context.Context) (django.User, error)
	GetOrCreateTracker(context.Context, *http.Request) (string, error)
}

func NewFakeHTTPService

func NewFakeHTTPService() HTTPService

func NewHTTPService

func NewHTTPService(
	addr string, ctx context.Context, sessions django.SessionStore,
) HTTPService

Jump to

Keyboard shortcuts

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