pkg

package
v0.0.0-...-ed5be40 Latest Latest
Warning

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

Go to latest
Published: May 29, 2016 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound     = errors.New("Not found")
	ErrUnauthorized = errors.New("Unauthorized")
	ErrForbidden    = errors.New("Forbidden")
)
View Source
var HMACStrategy = &strategy.HMACSHAStrategy{
	Enigma: &hmac.HMACStrategy{
		GlobalSecret: []byte("1234567890123456789012345678901234567890"),
	},
}

Functions

func AssertError

func AssertError(t *testing.T, expectError bool, err error, args ...interface{})

func CopyURL

func CopyURL(u *url.URL) *url.URL

func ForwardToErrorHandler

func ForwardToErrorHandler(w http.ResponseWriter, r *http.Request, err error, errorHandlerURL url.URL)

func FositeStore

func FositeStore() *store.Store

func GenerateSecret

func GenerateSecret(length int) ([]byte, error)

func JoinURL

func JoinURL(u *url.URL, args ...string) (ep *url.URL)

func JoinURLStrings

func JoinURLStrings(host string, args ...string) string

func LadonWarden

func LadonWarden(ps map[string]ladon.Policy) ladon.Warden

func LogError

func LogError(err error)

func Must

func Must(err error, message string, args ...interface{})

func MustArgs

func MustArgs(expected, actual int)

func RequireError

func RequireError(t *testing.T, expectError bool, err error, args ...interface{})

func Retry

func Retry(maxWait time.Duration, failAfter time.Duration, f func() error) (err error)

func Tokens

func Tokens(length int) (res [][]string)

Types

type SuperAgent

type SuperAgent struct {
	Client *http.Client
	URL    string
}

func NewSuperAgent

func NewSuperAgent(rawurl string) *SuperAgent

func (*SuperAgent) Create

func (s *SuperAgent) Create(o interface{}) error

func (*SuperAgent) Delete

func (s *SuperAgent) Delete() error

func (*SuperAgent) Get

func (s *SuperAgent) Get(o interface{}) error

func (*SuperAgent) POST

func (s *SuperAgent) POST(in, out interface{}) error

func (*SuperAgent) Update

func (s *SuperAgent) Update(o interface{}) error

Jump to

Keyboard shortcuts

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