package
0.0.0-20230331131523-deb0478a2e52
Repository: https://github.com/hellobchain/third_party.git
Documentation: pkg.go.dev
# Packages
Package client implements the a Go client for CFSSL API commands.
# Functions
HandleError is the centralised error handling and reporting.
NewErrorResponse is a shortcut for creating an error response for a single error.
NewSuccessResponse is a shortcut for creating new successul API responses.
NewSuccessResponseWithMessage is a shortcut for creating new successul API responses that includes a message.
ProcessRequestFirstMatchOf reads a JSON blob for the request and returns the first match of a set of keywords.
ProcessRequestOneOf reads a JSON blob for the request and makes sure it contains one of a set of keywords.
SendResponse builds a response from the result, sets the JSON header, and writes to the http.ResponseWriter.
SendResponseWithMessage builds a response from the result and the provided message, sets the JSON header, and writes to the http.ResponseWriter.
# Structs
HTTPHandler is a wrapper that encapsulates Handler interface as http.Handler.
Response implements the CloudFlare standard for API responses.
ResponseMessage implements the standard for response errors and messages.
# Interfaces
Handler is an interface providing a generic mechanism for handling HTTP requests.
# Type aliases
HandlerFunc is similar to the http.HandlerFunc type; it serves as an adapter allowing the use of ordinary functions as Handlers.