api

package
v0.0.0-...-aec784a Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequestBody     = errors.New("btcgw:invalid_request_body")
	ErrInvalidRequestBodyDesc = "Request body should be a JSON."

	ErrInvalidParam     = errors.New("btcgw::invalid_param")
	ErrInvalidParamDesc = "Parameter should be a 32 bytes binary in hexadecimal string."

	ErrDigestNotFound     = errors.New("btcgw::digest_not_found")
	ErrDigestNotFoundDesc = "Digest not found."

	ErrRegisterFailed     = errors.New("btcgw::register_failed")
	ErrRegisterFailedDesc = "Could not register. There may be a system error."

	ErrDigestAlreadyExists     = errors.New("btcgw::digest_already_exists")
	ErrDigestAlreadyExistsDesc = "Digest already exists."

	ErrAPIKeyCreationFailed     = errors.New("btcgw::apikey_creation_failed")
	ErrAPIKeyCreationFailedDesc = "Could not create API Key. There may be a system error."

	ErrAPIKeyDeletionFailed     = errors.New("btcgw::apikey_deletion_failed")
	ErrAPIKeyDeletionFailedDesc = "Could not delete API Key. There may be a system error."

	ErrCouldNotClose = errors.New("ErrCouldNotClose")
)
View Source
var APIKeyHandlerFromMux = apikey.HandlerFromMux
View Source
var AnchorHandlerFromMux = anchor.HandlerFromMux
View Source
var PrettifyResponseJSON = false

Functions

func WriteJSON

func WriteJSON(w http.ResponseWriter, code int, v interface{})

Types

type APIKeyService

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

func NewAPIKeyService

func NewAPIKeyService(d *auth.DocstoreAuth) *APIKeyService

func (*APIKeyService) Close

func (a *APIKeyService) Close() error

func (*APIKeyService) OAPIValidator

func (a *APIKeyService) OAPIValidator() func(next http.Handler) http.Handler

OAPIValidator sets up OpenAPI validator and must be set as a middleware.

func (*APIKeyService) PostApikeysCreate

func (a *APIKeyService) PostApikeysCreate(w http.ResponseWriter, r *http.Request)

func (*APIKeyService) PostApikeysDelete

func (a *APIKeyService) PostApikeysDelete(w http.ResponseWriter, r *http.Request)

type GatewayService

type GatewayService struct {
	gw.Gateway
	auth.Authenticator
}

TODO: cache

func NewGatewayService

func NewGatewayService(gw gw.Gateway, authenticator auth.Authenticator) *GatewayService

func (*GatewayService) Close

func (g *GatewayService) Close() error

func (*GatewayService) GetAnchorsDomainsDomainDigestsDigest

func (g *GatewayService) GetAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request, dom string, dig string)

func (*GatewayService) OAPIValidator

func (g *GatewayService) OAPIValidator() func(next http.Handler) http.Handler

OAPIValidator sets up OpenAPI validator and must be set as a middleware.

func (*GatewayService) PatchAnchorsDomainsDomainDigestsDigest

func (g *GatewayService) PatchAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request, dom string, dig string)

func (*GatewayService) PostAnchorsDomainsDomainDigestsDigest

func (g *GatewayService) PostAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request, dom string, dig string)

Directories

Path Synopsis
Package anchor provides primitives to interact the openapi HTTP API.
Package anchor provides primitives to interact the openapi HTTP API.
Package apikey provides primitives to interact the openapi HTTP API.
Package apikey provides primitives to interact the openapi HTTP API.

Jump to

Keyboard shortcuts

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