api

package
v0.0.0-...-25adc38 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2014 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package api provides the HTTP API implementation of the goat BitTorrent tracker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(msg string) string

ErrorResponse returns an Error as JSON

func Router

func Router(w http.ResponseWriter, r *http.Request)

Router handles the routing of HTTP API requests

Types

type BasicAuthenticator

type BasicAuthenticator struct {
}

BasicAuthenticator uses the HTTP Basic authentication scheme

func (BasicAuthenticator) Auth

func (a BasicAuthenticator) Auth(r *http.Request) bool

Auth handles validation of HTTP Basic authentication

type Error

type Error struct {
	Error string `json:"error"`
}

Error represents an error response from the API

type HMACAuthenticator

type HMACAuthenticator struct {
}

HMACAuthenticator uses the HMAC-SHA1 authentication scheme

func (HMACAuthenticator) Auth

func (a HMACAuthenticator) Auth(r *http.Request) bool

Auth handles validation of HMAC-SHA1 authentication

Jump to

Keyboard shortcuts

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