Versions in this module Expand all Collapse all v0 v0.5.1 Nov 28, 2022 Changes in this version + const StatusError + const StatusOk + var AccessKeyTypeAdmin = AccessKeyType + var AccessKeyTypeInvoice = AccessKeyType + var AccessKeyTypeNone = AccessKeyType + var AuthTypeBasic = AuthType + var AuthTypeBearerBase64 = AuthType + var AuthTypeNone = AuthType + func AuthorizationMiddleware(database *gorm.DB, authType AuthType, accessType AccessKeyType, ...) http.HandlerFunc + func LoggingMiddleware(prefix string, next http.HandlerFunc) http.HandlerFunc + func NotFoundHandler(writer http.ResponseWriter, err error) + func Proxy(wr http.ResponseWriter, req *http.Request, rawUrl string) error + func RespondError(w http.ResponseWriter, message string) + func WriteResponse(writer http.ResponseWriter, response interface{}) error + type AccessKeyType struct + Type string + type AuthType struct + Decoder func(s string) ([]byte, error) + Type string + type BalanceResponse struct + Balance int64 + type CreateInvoiceRequest struct + Amount int64 + DescriptionHash string + Memo string + UnhashedDescription string + type CreateInvoiceResponse struct + PayRequest string + PaymentHash string + Preimage string + type ErrorResponse struct + Message string + type InvoiceStatusResponse struct + PaymentHash string + Preimage int64 + State string + type InvoiceStream struct + Amount int + Bolt11 string + CheckingID string + Extra struct{} + Fee int + Memo string + PaymentHash string + Pending bool + Preimage string + Time int + WalletID string + Webhook string + WebhookStatus interface{} + type PayInvoiceRequest struct + PayRequest string + type Server struct + func NewServer(address string) *Server + func (w *Server) AppendAuthorizedRoute(path string, authType AuthType, accessType AccessKeyType, database *gorm.DB, ...) + func (w *Server) AppendRoute(path string, handler func(http.ResponseWriter, *http.Request), ...) + func (w *Server) ListenAndServe() + func (w *Server) PathPrefix(path string, handler http.Handler) + type Service struct + Bot *telegram.TipBot + func (s Service) Balance(w http.ResponseWriter, r *http.Request) + func (s Service) CreateInvoice(w http.ResponseWriter, r *http.Request) + func (s Service) InvoiceStatus(w http.ResponseWriter, r *http.Request) + func (s Service) InvoiceStream(w http.ResponseWriter, r *http.Request) + func (s Service) PayInvoice(w http.ResponseWriter, r *http.Request) + func (s Service) PaymentStatus(w http.ResponseWriter, r *http.Request)