html

package
v0.0.0-...-8f31e64 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a, b int) int

func AltCurrency

func AltCurrency(
	pricer service.QuotePricer,
	curCode *string,
) func(*librefund.Money) *librefund.Money

func ToTitle

func ToTitle(arg string) string

Types

type About

type About struct {
	*librefund.Project

	RootURL  string
	Selected string
	Title    string

	TotalContributions int
	TotalUpdates       int
}

func NewAbout

func NewAbout(
	srv *service.Service,
	project string,
) (*About, error)

type Contribute

type Contribute struct {
	*librefund.Project

	RootURL string
	Title   string

	Currency                  string
	MinContribution           *librefund.Money
	MaxContribution           *librefund.Money
	TransferMethod            string
	SuggestedContribution     *librefund.Money
	SuggestedContributionStep decimal.Decimal
	SuggestedContributions    []*librefund.Money

	ShowTermsAndConditions bool
	Objective              *Objective
	FieldErrors            schema.MultiError
	Error                  error
}

func NewContribute

func NewContribute(
	srv *service.Service,
	project string,
	objective librefund.Version,
) (*Contribute, error)

func (*Contribute) AddError

func (t *Contribute) AddError(err error)

type ContributeBitcoin

type ContributeBitcoin struct {
	RootURL string
	Title   string

	BitcoinAddress   string
	BitcoinURI       template.URL
	Project          *librefund.Project
	Objective        *librefund.Objective
	PaymentInfo      *bitcoin.PaymentInfo
	PaymentReference string
}

func NewContributeBitcoin

func NewContributeBitcoin(
	srv *service.Service,
	payInfo *bitcoin.PaymentInfo,
	project string,
) (*ContributeBitcoin, error)

type Objective

type Objective struct {
	*librefund.Objective
	Description      template.HTML
	ShortDescription template.HTML
	RefundPerc       librefund.Percentage
	ImpactPerc       librefund.Percentage
}

func NewObjective

func NewObjective(
	cfg *librefund.Config,
	obj *librefund.Objective,
	quotePricer service.QuotePricer,
) (*Objective, error)

type Project

type Project struct {
	*librefund.Project

	RootURL  string
	Selected string
	Title    string

	Contributions      []*librefund.Contribution
	Objectives         []*Objective
	TotalContributions int
	TotalUpdates       int
	Updates            []librefund.Update
}

func NewProject

func NewProject(
	srv *service.Service,
	project string,
) (*Project, error)

type ProjectContributions

type ProjectContributions struct {
	*librefund.Project

	RootURL  string
	Selected string
	Title    string

	Contributions      []*librefund.Contribution
	TotalContributions int
	TotalUpdates       int
}

func NewProjectContributions

func NewProjectContributions(
	srv *service.Service,
	project string,
) (*ProjectContributions, error)

type ProjectUpdates

type ProjectUpdates struct {
	*librefund.Project

	RootURL  string
	Selected string
	Title    string

	TotalContributions int
	TotalUpdates       int
	Updates            []librefund.Update
}

func NewProjectUpdates

func NewProjectUpdates(
	srv *service.Service,
	project string,
) (*ProjectUpdates, error)

type Renderer

type Renderer struct {
	Config *librefund.Config
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer(
	config *librefund.Config,
	pricer service.QuotePricer,
	urls URLGetter,
) (*Renderer, error)

func (*Renderer) QRCodeURL

func (r *Renderer) QRCodeURL(payload template.URL) (string, error)

func (*Renderer) RenderAbout

func (r *Renderer) RenderAbout(w io.Writer, arg *About) error

func (*Renderer) RenderContribute

func (r *Renderer) RenderContribute(w io.Writer, arg *Contribute) error

func (*Renderer) RenderContributeBitcoin

func (r *Renderer) RenderContributeBitcoin(w io.Writer, arg *ContributeBitcoin) error

func (*Renderer) RenderProject

func (r *Renderer) RenderProject(w io.Writer, arg *Project) error

func (*Renderer) RenderProjectContributions

func (r *Renderer) RenderProjectContributions(w io.Writer, arg *ProjectContributions) error

func (*Renderer) RenderProjectUpdates

func (r *Renderer) RenderProjectUpdates(w io.Writer, arg *ProjectUpdates) error

func (*Renderer) RenderServiceAgreement

func (r *Renderer) RenderServiceAgreement(w io.Writer, arg *ServiceAgreement) error

type ServiceAgreement

type ServiceAgreement struct {
	*librefund.Project

	RootURL string
	Title   string

	TermsAndConditions template.HTML
}

func NewServiceAgreement

func NewServiceAgreement(
	srv *service.Service,
	project string,
) (*ServiceAgreement, error)

type URLGetter

type URLGetter interface {
	GetURL(routeName string, attr ...string) (string, error)
}

Jump to

Keyboard shortcuts

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