webserver

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BlueOak-1.0.0 Imports: 47 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTranslations added in v1.0.0

func RegisterTranslations()

RegisterTranslations registers translations with the init package for translator worksheet preparation.

Types

type CommonArguments

type CommonArguments struct {
	UserInfo       *userInfo
	Title          string
	UseDEXBranding bool
}

CommonArguments are common page arguments that must be supplied to every page to populate the <title> and <header> elements.

type Config added in v0.4.0

type Config struct {
	Core          clientCore // *core.Core
	MarketMaker   MMCore     // *mm.MarketMaker
	Addr          string
	CustomSiteDir string
	Language      string
	Logger        dex.Logger
	UTC           bool // for stdout http request logging
	CertFile      string
	KeyFile       string
	// NoEmbed indicates to serve files from the system disk rather than the
	// embedded files. Since this is a developer setting, this also implies
	// reloading of templates on each request. Note that only embedded files
	// should be used by default since site files from older distributions may
	// be present on the disk. When NoEmbed is true, this also implies reloading
	// and execution of html templates on each request.
	NoEmbed  bool
	HttpProf bool
}

type MMCore added in v1.0.0

type MMCore interface {
	MarketReport(host string, base, quote uint32) (*mm.MarketReport, error)
	StartBot(mkt *mm.StartConfig, alternateConfigPath *string, pw []byte) (err error)
	StopBot(mkt *mm.MarketWithHost) error
	UpdateCEXConfig(updatedCfg *mm.CEXConfig) error
	CEXBalance(cexName string, assetID uint32) (*libxc.ExchangeBalance, error)
	UpdateBotConfig(updatedCfg *mm.BotConfig) error
	RemoveBotConfig(host string, baseID, quoteID uint32) error
	Status() *mm.Status
	ArchivedRuns() ([]*mm.MarketMakingRun, error)
	RunOverview(startTime int64, mkt *mm.MarketWithHost) (*mm.MarketMakingRunOverview, error)
	RunLogs(startTime int64, mkt *mm.MarketWithHost, n uint64, refID *uint64, filter *mm.RunLogFilters) (events, updatedEvents []*mm.MarketMakingEvent, overview *mm.MarketMakingRunOverview, err error)
	CEXBook(host string, baseID, quoteID uint32) (buys, sells []*core.MiniOrder, _ error)
}

type WebServer

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

WebServer is a single-client http and websocket server enabling a browser interface to Bison Wallet.

func New

func New(cfg *Config) (*WebServer, error)

New is the constructor for a new WebServer. CustomSiteDir in the Config can be left blank, in which case a handful of default locations will be checked. This will work in most cases.

func (*WebServer) Addr added in v0.6.0

func (s *WebServer) Addr() string

Addr gives the address on which WebServer is listening. Use only after Connect.

func (*WebServer) Connect

func (s *WebServer) Connect(ctx context.Context) (*sync.WaitGroup, error)

Connect starts the web server. Satisfies the dex.Connector interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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