Documentation ¶
Index ¶
- Variables
- type Config
- type OfferSet
- type OpenSourcePartner
- type OrganizedOffers
- type PartnerSet
- type Server
- func (s *Server) Close() error
- func (s *Server) CreateOffer(w http.ResponseWriter, req *http.Request)
- func (s *Server) GetBaseURL() string
- func (s *Server) GetOffers(w http.ResponseWriter, req *http.Request)
- func (server *Server) OrganizeOffersByStatus(offers rewards.Offers) OrganizedOffers
- func (server *Server) OrganizeOffersByType(offers rewards.Offers) OfferSet
- func (s *Server) Run(ctx context.Context) error
- func (s *Server) StopOffer(w http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
var Error = errs.Class("satellite marketing error")
Error is satellite marketing error type.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { BaseURL string `help:"base url for marketing Admin GUI" default:""` Address string `help:"server address of the marketing Admin GUI" default:"127.0.0.1:8090"` StaticDir string `help:"path to static resources" default:""` }
Config contains configuration for marketingweb server.
type OfferSet ¶ added in v0.26.0
type OfferSet struct { ReferralOffers OrganizedOffers FreeCredits OrganizedOffers PartnerTables PartnerSet }
OfferSet provides a separation of marketing offers by type.
type OpenSourcePartner ¶ added in v0.26.0
type OpenSourcePartner struct { rewards.PartnerInfo PartnerOffers OrganizedOffers }
OpenSourcePartner contains all data for an Open Source Partner.
type OrganizedOffers ¶ added in v0.26.0
OrganizedOffers contains a list of offers organized by status.
type PartnerSet ¶ added in v0.26.0
type PartnerSet []OpenSourcePartner
PartnerSet contains a list of Open Source Partners.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents marketing offersweb server.
architecture: Endpoint
func NewServer ¶
func NewServer(logger *zap.Logger, config Config, rewards rewards.DB, partners *rewards.PartnersService, listener net.Listener) (*Server, error)
NewServer creates new instance of offersweb server.
func (*Server) CreateOffer ¶
func (s *Server) CreateOffer(w http.ResponseWriter, req *http.Request)
CreateOffer handles requests to create new offers.
func (*Server) GetBaseURL ¶ added in v0.20.0
GetBaseURL returns base url from config.
func (*Server) GetOffers ¶
func (s *Server) GetOffers(w http.ResponseWriter, req *http.Request)
GetOffers renders the tables for free credits and referral offers to the UI.
func (*Server) OrganizeOffersByStatus ¶ added in v0.26.0
func (server *Server) OrganizeOffersByStatus(offers rewards.Offers) OrganizedOffers
OrganizeOffersByStatus organizes offers by OfferStatus.
func (*Server) OrganizeOffersByType ¶ added in v0.26.0
OrganizeOffersByType organizes offers by OfferType.