httper

package
v0.0.0-...-c5da714 Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CookieHTTPDataProvider

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

CookieHTTPDataProvider helps to deal with GET.

func (CookieHTTPDataProvider) Get

func (c CookieHTTPDataProvider) Get(prefix, name string) string

Get a string

func (CookieHTTPDataProvider) GetAny

func (c CookieHTTPDataProvider) GetAny(prefix, name string) interface{}

GetAny kind of value

func (CookieHTTPDataProvider) GetName

func (c CookieHTTPDataProvider) GetName() string

GetName returns cookie

func (CookieHTTPDataProvider) IsAbout

func (c CookieHTTPDataProvider) IsAbout(prefix string) bool

IsAbout returns true when prefix is get

type CookieHelper

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

CookieHelper helps to deal with cookies.

func (CookieHelper) Get

func (c CookieHelper) Get(name string) string

Get a cookie value

func (CookieHelper) GetCookie

func (c CookieHelper) GetCookie(name string) *http.Cookie

GetCookie returns a plain cookie.

func (CookieHelper) Set

func (c CookieHelper) Set(name string, value string, t ...time.Time) *http.Cookie

Set a cookie value

func (CookieHelper) SetCookie

func (c CookieHelper) SetCookie(cookie *http.Cookie)

SetCookie sets a plain cookie

type CookieHelperProvider

type CookieHelperProvider struct{}

CookieHelperProvider instancatiates CookieHelpers.

func (CookieHelperProvider) Make

Make returns a CookieHelper

type CookieProvider

type CookieProvider interface {
	Make(w http.ResponseWriter, r *http.Request) Cookier
}

CookieProvider is a Cookier factory.

type Cookier

type Cookier interface {
	Get(name string) string
	GetCookie(name string) *http.Cookie
	Set(name string, value string, t ...time.Time) *http.Cookie
	SetCookie(cookie *http.Cookie)
}

Cookier defines a cookie provider requirements.

type DataProvider

type DataProvider interface {
	Dataer
	IsAbout(string) bool
	GetName() string
}

DataProvider isa Dataer able to tell about more a prefix

type DataProviderFacade

type DataProviderFacade struct {
	Providers []DataProvider
}

DataProviderFacade multiple providers

func NewDataProviderFacade

func NewDataProviderFacade(providers ...DataProvider) *DataProviderFacade

NewDataProviderFacade constructs a data provider facade.

func (*DataProviderFacade) Get

func (c *DataProviderFacade) Get(prefix, name string) string

Get a string

func (*DataProviderFacade) GetAny

func (c *DataProviderFacade) GetAny(prefix, name string) interface{}

GetAny kind of value

type Dataer

type Dataer interface {
	Get(prefix, name string) string
	GetAny(prefix, name string) interface{}
}

Dataer defines a data provider requirements.

type DataerProvider

type DataerProvider interface {
	Make(w http.ResponseWriter, r *http.Request) Dataer
	MakeEmpty() Dataer
}

DataerProvider is a Dataer factory.

type DefaultFinalizer

type DefaultFinalizer struct {
}

DefaultFinalizer for an http response.

func (DefaultFinalizer) HandleError

func (f DefaultFinalizer) HandleError(err error, w io.Writer, r *http.Request) bool

HandleError prints http 500.

func (DefaultFinalizer) HandleSuccess

func (f DefaultFinalizer) HandleSuccess(w io.Writer, r io.Reader) error

HandleSuccess prints http 200 and prints r.

type Finalizer

type Finalizer interface {
	HandleError(err error, w io.Writer, r *http.Request) bool
	HandleSuccess(w io.Writer, r io.Reader) error
}

Finalizer finalizes an htpp response.

type GetHTTPDataProvider

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

GetHTTPDataProvider helps to deal with GET.

func (GetHTTPDataProvider) Get

func (c GetHTTPDataProvider) Get(prefix, name string) string

Get a string

func (GetHTTPDataProvider) GetAny

func (c GetHTTPDataProvider) GetAny(prefix, name string) interface{}

GetAny kind of value

func (GetHTTPDataProvider) GetName

func (c GetHTTPDataProvider) GetName() string

GetName returns get

func (GetHTTPDataProvider) IsAbout

func (c GetHTTPDataProvider) IsAbout(prefix string) bool

IsAbout returns true when prefix is get

type GorillaHTTPDataProvider

type GorillaHTTPDataProvider struct {
	StdHTTPDataProvider

	Name string
	// contains filtered or unexported fields
}

GorillaHTTPDataProvider returns a data provider for a standard http handlingr.

func (GorillaHTTPDataProvider) Make

Make returns a DataHelper

func (GorillaHTTPDataProvider) MakeEmpty

func (c GorillaHTTPDataProvider) MakeEmpty() Dataer

MakeEmpty returns a DataHelper

type GorillaSession

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

GorillaSession helps to deal with cookies.

func (GorillaSession) Get

func (c GorillaSession) Get(name string) string

Get a string

func (GorillaSession) GetAny

func (c GorillaSession) GetAny(name string) interface{}

GetAny returns any kind of value.

func (GorillaSession) Set

func (c GorillaSession) Set(name, value string)

Set a string.

func (GorillaSession) SetAny

func (c GorillaSession) SetAny(name string, value interface{})

SetAny kind of value.

type GorillaSessionHTTPDataProvider

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

GorillaSessionHTTPDataProvider helps to deal with URL.

func (GorillaSessionHTTPDataProvider) Get

func (c GorillaSessionHTTPDataProvider) Get(prefix, name string) string

Get a string

func (GorillaSessionHTTPDataProvider) GetAny

func (c GorillaSessionHTTPDataProvider) GetAny(prefix, name string) interface{}

GetAny kind of value

func (GorillaSessionHTTPDataProvider) GetName

GetName returns session

func (GorillaSessionHTTPDataProvider) IsAbout

func (c GorillaSessionHTTPDataProvider) IsAbout(prefix string) bool

IsAbout returns true when prefix is get

type GorillaSessionProvider

type GorillaSessionProvider struct {
	Name string
	// contains filtered or unexported fields
}

GorillaSessionProvider instancatiates SessionProvider.

func (GorillaSessionProvider) Make

Make returns a SessionProvider

type HTTPFinalizer

type HTTPFinalizer struct {
	DefaultFinalizer
}

HTTPFinalizer finalizes an HTTP response.

func (HTTPFinalizer) HandleSuccess

func (f HTTPFinalizer) HandleSuccess(w io.Writer, r io.Reader) error

HandleSuccess prints http 200 and prints r.

type PostHTTPDataProvider

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

PostHTTPDataProvider helps to deal with GET.

func (PostHTTPDataProvider) Get

func (c PostHTTPDataProvider) Get(prefix, name string) string

Get a string

func (PostHTTPDataProvider) GetAny

func (c PostHTTPDataProvider) GetAny(prefix, name string) interface{}

GetAny kind of value

func (PostHTTPDataProvider) GetName

func (c PostHTTPDataProvider) GetName() string

GetName returns post

func (PostHTTPDataProvider) IsAbout

func (c PostHTTPDataProvider) IsAbout(prefix string) bool

IsAbout returns true when prefix is get

type ReqHTTPDataProvider

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

ReqHTTPDataProvider helps to deal with Req.

func (ReqHTTPDataProvider) Get

func (c ReqHTTPDataProvider) Get(prefix, name string) string

Get a string

func (ReqHTTPDataProvider) GetAny

func (c ReqHTTPDataProvider) GetAny(prefix, name string) interface{}

GetAny kind of value

func (ReqHTTPDataProvider) GetName

func (c ReqHTTPDataProvider) GetName() string

GetName returns req

func (ReqHTTPDataProvider) IsAbout

func (c ReqHTTPDataProvider) IsAbout(prefix string) bool

IsAbout returns true when prefix is get

type RouteHTTPDataProvider

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

RouteHTTPDataProvider helps to deal with URL.

func (RouteHTTPDataProvider) Get

func (c RouteHTTPDataProvider) Get(prefix, name string) string

Get a string

func (RouteHTTPDataProvider) GetAny

func (c RouteHTTPDataProvider) GetAny(prefix, name string) interface{}

GetAny kind of value

func (RouteHTTPDataProvider) GetName

func (c RouteHTTPDataProvider) GetName() string

GetName returns route

func (RouteHTTPDataProvider) IsAbout

func (c RouteHTTPDataProvider) IsAbout(prefix string) bool

IsAbout returns true when prefix is get

type SessionProvider

type SessionProvider interface {
	Make(w http.ResponseWriter, r *http.Request) Sessionner
}

SessionProvider is a Sessionner factory.

type Sessionner

type Sessionner interface {
	Get(name string) string
	GetAny(name string) interface{}
	Set(name string, value string)
	SetAny(name string, value interface{})
}

Sessionner defines a session provider requirements.

type StdHTTPDataProvider

type StdHTTPDataProvider struct{}

StdHTTPDataProvider returns a data provider for a standard http handlingr.

func (StdHTTPDataProvider) Make

Make returns a DataHelper

func (StdHTTPDataProvider) MakeEmpty

func (c StdHTTPDataProvider) MakeEmpty() Dataer

MakeEmpty returns a DataHelper

type URLHTTPDataProvider

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

URLHTTPDataProvider helps to deal with URL.

func (URLHTTPDataProvider) Get

func (c URLHTTPDataProvider) Get(prefix, name string) string

Get a string

func (URLHTTPDataProvider) GetAny

func (c URLHTTPDataProvider) GetAny(prefix, name string) interface{}

GetAny kind of value

func (URLHTTPDataProvider) GetName

func (c URLHTTPDataProvider) GetName() string

GetName returns url

func (URLHTTPDataProvider) IsAbout

func (c URLHTTPDataProvider) IsAbout(prefix string) bool

IsAbout returns true when prefix is get

type VoidSession

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

VoidSession helps to deal with cookies.

func (VoidSession) Get

func (c VoidSession) Get(name string) string

Get a string

func (VoidSession) GetAny

func (c VoidSession) GetAny(name string) interface{}

GetAny returns any kind of value.

func (VoidSession) Set

func (c VoidSession) Set(name, value string)

Set a string.

func (VoidSession) SetAny

func (c VoidSession) SetAny(name string, value interface{})

SetAny kind of value.

type VoidSessionProvider

type VoidSessionProvider struct {
}

VoidSessionProvider instancatiates SessionProvider.

func (VoidSessionProvider) Make

Make returns a SessionProvider

Jump to

Keyboard shortcuts

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