connector

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: BSD-3-Clause Imports: 6 Imported by: 2

README

go-connector

Go client API for Manifold's provider-facing connector service (unstable)

Code of Conduct | Contribution Guidelines

GitHub release GoDoc Travis Go Report Card License

Overview

This will be the Go implementation of a client API for Manifold's provider facing REST services. For now, it is unstable as we build it, and is used to share code between some of our other packages.

If you are a provider, you'll want to look at grafton for verifying your implementation, or go-signature for verifying requests have come from Manifold instead.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToOAuthError

func ToOAuthError(err error) manifold.HTTPError

ToOAuthError receives an error and mutates it into an OAuthError based on the concrete type of the Error

Types

type OAuthError

type OAuthError struct {
	Type        merrors.Type          `json:"-"`
	ErrorType   errors.OAuthErrorType `json:"error"`
	Description string                `json:"error_description,omitempty"`
}

OAuthError represents an error that follows the OAuth 2.0 specification. An OAuthError occurs during a component of an OAuth authentication flow.

These errors are only surfaced to a provider.

func NewOAuthError

func NewOAuthError(t errors.OAuthErrorType, description string) *OAuthError

NewOAuthError returns an OAuthError which satisfies the Error, HTTPError and swag.Error interfaces.

description is optional and will be omitted from the response if its an empty string.

func (*OAuthError) Error

func (e *OAuthError) Error() string

Error returns a string equivalent of this Error. It also completes the error interface.

func (*OAuthError) StatusCode

func (e *OAuthError) StatusCode() int

StatusCode returns the http status code for this Error. It completes the HTTPError interface.

func (*OAuthError) WriteResponse

func (e *OAuthError) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)

WriteResponse completes the interface for a HTTPError; enabling an error to be returned as a middleware.Responder from go-openapi/runtime

A panic will occur if the given producer errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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