utils

package
v0.0.0-...-8c3e621 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolCpy

func BoolCpy(c bool) *bool

func Clear

func Clear(params *FakeParamsGetter, render *FakeRender, recorder *httptest.ResponseRecorder)

func FakeRequest

func FakeRequest(method, url string, body interface{}) *http.Request

func FakeRequestRaw

func FakeRequestRaw(method, url string, body []byte) *http.Request

func GenToken

func GenToken(strSize int) string

func IntCpy

func IntCpy(c int) *int

func RandInt

func RandInt(min int, max int) int

func StrCpy

func StrCpy(c string) *string

func TimeCpy

func TimeCpy(c time.Time) *time.Time

func ToJSONTime

func ToJSONTime(t time.Time) string

Types

type FakeModelsGetter

type FakeModelsGetter struct {
	RedirectURL        string
	GrantAll           bool
	SessionValidity    time.Duration
	SessionTokenLength int
}

func NewFakeModelsGetter

func NewFakeModelsGetter() *FakeModelsGetter

func (*FakeModelsGetter) GetGrantAll

func (g *FakeModelsGetter) GetGrantAll() bool

func (*FakeModelsGetter) GetRedirectURL

func (g *FakeModelsGetter) GetRedirectURL() string

func (*FakeModelsGetter) GetSessionTokenLength

func (g *FakeModelsGetter) GetSessionTokenLength() int

func (*FakeModelsGetter) GetSessionValidity

func (g *FakeModelsGetter) GetSessionValidity() time.Duration

type FakeParamsGetter

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

func NewFakeParamsGetter

func NewFakeParamsGetter() *FakeParamsGetter

func (*FakeParamsGetter) Clear

func (g *FakeParamsGetter) Clear()

func (*FakeParamsGetter) ClearURLParams

func (g *FakeParamsGetter) ClearURLParams()

func (*FakeParamsGetter) GetURLParam

func (g *FakeParamsGetter) GetURLParam(req *http.Request, key string) string

func (*FakeParamsGetter) SetURLParam

func (g *FakeParamsGetter) SetURLParam(key, value string)

type FakeRender

type FakeRender struct {
	Status   int
	APIError *zest.APIError
	Err      error
	// contains filtered or unexported fields
}

func NewFakeRender

func NewFakeRender() *FakeRender

func (*FakeRender) Clear

func (r *FakeRender) Clear()

func (*FakeRender) JSON

func (r *FakeRender) JSON(w http.ResponseWriter, status int, object interface{})

func (*FakeRender) JSONError

func (r *FakeRender) JSONError(w http.ResponseWriter, status int, apiError *zest.APIError, err error)

Jump to

Keyboard shortcuts

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