marketingweb

package
v0.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2019 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("satellite marketing error")

Error is satellite marketing error type

Functions

This section is empty.

Types

type Config

type Config struct {
	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 Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents marketing offersweb server

func NewServer

func NewServer(logger *zap.Logger, config Config, db rewards.DB, listener net.Listener) (*Server, error)

NewServer creates new instance of offersweb server

func (*Server) Close

func (s *Server) Close() error

Close closes server and underlying listener

func (*Server) CreateOffer

func (s *Server) CreateOffer(w http.ResponseWriter, req *http.Request)

CreateOffer handles requests to create new offers.

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) Run

func (s *Server) Run(ctx context.Context) error

Run starts the server that host admin web app and api endpoint

func (*Server) StopOffer

func (s *Server) StopOffer(w http.ResponseWriter, req *http.Request)

StopOffer expires the current offer and replaces it with the default offer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL