Documentation ¶
Index ¶
- type Config
- type Opt
- func NoOpt() Opt
- func WithAuthDebug(files fs.FS) Opt
- func WithBodyDump() Opt
- func WithDashboardAPI(cfg Config, handler *merchantapi.Handler, authHandler *merchantauth.Handler, ...) Opt
- func WithDocs(files fs.FS) Opt
- func WithEmbeddedFrontend(dashboardUI, paymentsUI fs.FS) Opt
- func WithInternalAPI(h *v1.Handler) Opt
- func WithLogger(logger *zerolog.Logger) Opt
- func WithMerchantAPI(handler *merchantapi.Handler, tokensManager *auth.TokenAuthManager) Opt
- func WithPaymentAPI(handler *paymentapi.Handler, cfg Config) Opt
- func WithRecover() Opt
- func WithWebhookAPI(handler *webhook.Handler) Opt
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Address string `yaml:"address" env:"WEB_ADDRESS" env-default:"0.0.0.0" env-description:"Listen address"` Port string `yaml:"port" env:"WEB_PORT" env-default:"80" env-description:"Listen port"` Session middleware.SessionConfig `yaml:"session"` CSRF middleware.CSRFConfig `yaml:"csrf"` CORS middleware.CORSConfig `yaml:"cors"` EnableInternalAPI bool `` /* 155-byte string literal not displayed */ }
type Opt ¶
type Opt func(s *Server)
func WithAuthDebug ¶
func WithBodyDump ¶
func WithBodyDump() Opt
func WithDashboardAPI ¶
func WithDashboardAPI( cfg Config, handler *merchantapi.Handler, authHandler *merchantauth.Handler, tokensManager *auth.TokenAuthManager, users *user.Service, enableEmailAuth bool, enableGoogleAuth bool, ) Opt
WithDashboardAPI setups routes for Merchant's Dashboard (app.o2pay.co)
func WithEmbeddedFrontend ¶
func WithInternalAPI ¶
func WithLogger ¶
func WithMerchantAPI ¶
func WithMerchantAPI(handler *merchantapi.Handler, tokensManager *auth.TokenAuthManager) Opt
WithMerchantAPI setups Merchant's API routes (api.o2pay.co)
func WithPaymentAPI ¶
func WithPaymentAPI(handler *paymentapi.Handler, cfg Config) Opt
WithPaymentAPI setups routes public-facing payment api (pay.o2pay.co)
func WithRecover ¶
func WithRecover() Opt
func WithWebhookAPI ¶
Click to show internal directories.
Click to hide internal directories.