Documentation
¶
Index ¶
- Variables
- func BadRequest(w http.ResponseWriter, reason error)
- func Clear()
- func Forbidden(w http.ResponseWriter, reason error)
- func GInternalServerError(w http.ResponseWriter)
- func GetProperError(err error) string
- func HandleError(w http.ResponseWriter, status int, reason error)
- func InternalServerError(w http.ResponseWriter, reason error)
- func NotFound(w http.ResponseWriter, reason error)
- func Run(name string, arg ...string)
- func SetTitle(format string, content ...interface{})
- func Unauthorized(w http.ResponseWriter, reason error)
- type ConfigVars
- type EnvVars
- type ErrorResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Solana Errors ErrInvalidStatus = errors.New("invalid status") ErrNoMetadata = errors.New("no metadata") ErrTransactionOverboard = errors.New("transaction has gone overboard") // Database Errors ErrMustBePointer = errors.New("must be a pointer") ErrNotFound = errors.New("no matches found") ErrFilterCollision = errors.New("collision on filter") // HTTP Errors ErrNotJSON = errors.New("not json") ErrInvalidCallbackURI = errors.New("invalid callback uri") ErrInvalidAmount = errors.New("invalid amount") ErrTransactionSlipped = errors.New("transaction has slipped") ProperErrors = map[error]string{ ErrInvalidStatus: "Invalid confirmation status.", ErrNoMetadata: "No metadata in transaction.", ErrTransactionOverboard: "Transaction has gone overboard, retry with bonded transactions.", ErrNotFound: "No matches found in database.", ErrFilterCollision: "Collision on filter query.", ErrNotJSON: "Request contains invalid JSON. Please use application/json.", ErrInvalidCallbackURI: "Invalid callback uri.", ErrInvalidAmount: "Invalid amount to forward. Please provide a higher amount.", ErrTransactionSlipped: "Transaction has slipped threshold, user has not sent enough funds.", } )
View Source
var ( Env EnvVars Config ConfigVars )
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, reason error)
func Forbidden ¶
func Forbidden(w http.ResponseWriter, reason error)
func GInternalServerError ¶
func GInternalServerError(w http.ResponseWriter)
func GetProperError ¶
func HandleError ¶
func HandleError(w http.ResponseWriter, status int, reason error)
func InternalServerError ¶
func InternalServerError(w http.ResponseWriter, reason error)
func NotFound ¶
func NotFound(w http.ResponseWriter, reason error)
func Unauthorized ¶
func Unauthorized(w http.ResponseWriter, reason error)
Types ¶
type ConfigVars ¶
type ConfigVars struct {
RatelimitEvery int `json:"ratelimit_every"`
RatelimitReset int `json:"ratelimit_reset"`
Forwarder struct {
ForwardAddress string `json:"foward_address"`
MinForward float64 `json:"min_forward"`
TransactionThreshold float64 `json:"transaction_threshold"`
} `json:"forwarder"`
}
type ErrorResponse ¶
Click to show internal directories.
Click to hide internal directories.