api

package
v0.0.0-...-4a9ee8d Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2017 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(w http.ResponseWriter, errorCode int, reason string)

func SanitizeJSON

func SanitizeJSON(s []byte) ([]byte, error)

func SanitizedResponse

func SanitizedResponse(w http.ResponseWriter, response string)

func SanitizedResponseM

func SanitizedResponseM(w http.ResponseWriter, response string, m proto.Message)

Types

type Gateway

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

Gateway represents an HTTP API gateway

func NewGateway

func NewGateway(n *core.OpenBazaarNode, authCookie http.Cookie, l net.Listener, config repo.APIConfig, options ...corehttp.ServeOption) (*Gateway, error)

NewGateway instantiates a new `Gateway`

func (*Gateway) Close

func (g *Gateway) Close() error

Close shutsdown the Gateway listener

func (*Gateway) Serve

func (g *Gateway) Serve() error

Serve begins listening on the configured address

type JsonAPIConfig

type JsonAPIConfig struct {
	Headers       map[string][]string
	Enabled       bool
	Cors          *string
	Authenticated bool
	AllowedIPs    map[string]bool
	Cookie        http.Cookie
	Username      string
	Password      string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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