Documentation ¶
Overview ¶
Package anchor provides primitives to interact the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
Index ¶
- Constants
- func GetSwagger() (*openapi3.Swagger, error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- type Anchor
- type AnchorRecord
- type BadRequest
- type ChiServerOptions
- type ErrAnchorNotFound
- type Error
- type InternalServerError
- type MiddlewareFunc
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PatchAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request)
Constants ¶
const (
ApiKeyScopes = "ApiKey.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type Anchor ¶
type Anchor struct { // Target Bitcoin network. `Mainnet` `Testnet3` `Testnet4`(unsupported) Chain string `json:"chain"` // BBc-1 digest in hexadecimal string. Digest string `json:"digest"` // BBc-1 domain ID in hexadecimal string. Domain string `json:"domain"` // Timestamp embedded in the Anchor. Time int `json:"time"` // Anchor version. `1` `255`(test use only) Version int `json:"version"` }
Anchor defines model for Anchor.
type AnchorRecord ¶
type AnchorRecord struct { Anchor Anchor `json:"anchor"` // BBc-1 domain name that is not embedded in the Bitcoin transaction. Bbc1name *string `json:"bbc1name,omitempty"` // Bitcoin transaction ID in hexadecimal string. Btctx string `json:"btctx"` // Comfirmations of the Bitcoin transaction. Confirmations int `json:"confirmations"` // Arbitrary string that is not embedded in the Bitcoin transaction. Note *string `json:"note,omitempty"` // Timestamp in Bitcoin block chain. Time int `json:"time"` }
AnchorRecord defines model for AnchorRecord.
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc }
type ErrAnchorNotFound ¶
type ErrAnchorNotFound Error
ErrAnchorNotFound defines model for ErrAnchorNotFound.
type Error ¶
type Error struct { // Error code with prefix `btcgw::`. Error string `json:"error"` // Message to the user. ErrorDescription *string `json:"error_description,omitempty"` }
Error defines model for Error.
type InternalServerError ¶
type InternalServerError Error
InternalServerError defines model for InternalServerError.
type MiddlewareFunc ¶
type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc
type ServerInterface ¶
type ServerInterface interface { // Gets the anchor specified by BBc-1 domain ID and BBc-1 digest. // (GET /anchors/domains/{domain}/digests/{digest}) GetAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request, domain string, digest string) // Requests to update the status of the anchor specified by BBc-1 domain ID and BBc-1 digest. // (PATCH /anchors/domains/{domain}/digests/{digest}) PatchAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request, domain string, digest string) // Registers an anchor with specified BBc-1 domain ID and BBc-1 digest. // (POST /anchors/domains/{domain}/digests/{digest}) PostAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request, domain string, digest string) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetAnchorsDomainsDomainDigestsDigest ¶
func (siw *ServerInterfaceWrapper) GetAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request)
GetAnchorsDomainsDomainDigestsDigest operation middleware
func (*ServerInterfaceWrapper) PatchAnchorsDomainsDomainDigestsDigest ¶
func (siw *ServerInterfaceWrapper) PatchAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request)
PatchAnchorsDomainsDomainDigestsDigest operation middleware
func (*ServerInterfaceWrapper) PostAnchorsDomainsDomainDigestsDigest ¶
func (siw *ServerInterfaceWrapper) PostAnchorsDomainsDomainDigestsDigest(w http.ResponseWriter, r *http.Request)
PostAnchorsDomainsDomainDigestsDigest operation middleware