portal

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MinimumChargeableAmount added in v0.6.0

func MinimumChargeableAmount(currency string) float64

MinimumChargeableAmount is a helper function that returns the minimum amount chargeable by Stripe for the given currency.

Types

type Error

type Error struct {
	// Code identifies the error and enables an easier client-side error handling.
	Code int `json:"code"`
	// Message describes the error in English. Typically it is set to
	// `err.Error()`. This field is required.
	Message string `json:"message"`
}

Error is a type that is encoded as JSON and returned in an API response in the event of an error.

func (Error) Error

func (err Error) Error() string

Error implements the error interface for the Error type. It returns only the Message field.

type Portal

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

Portal contains the information related to the server.

func New

New returns an initialized portal server.

func (*Portal) Alerts

func (p *Portal) Alerts() (crit, err, warn, info []modules.Alert)

Alerts implements the modules.Alerter interface for the portal.

func (*Portal) Close

func (p *Portal) Close() error

Close shuts down the portal.

func (*Portal) GetAnnouncement added in v0.7.0

func (p *Portal) GetAnnouncement() (text string, expires uint64, err error)

GetAnnouncement returns the current portal announcement.

func (*Portal) GetCredits

func (p *Portal) GetCredits() modules.CreditData

GetCredits retrieves the credit data.

func (*Portal) ProcessConsensusChange added in v0.6.0

func (p *Portal) ProcessConsensusChange(cc modules.ConsensusChange)

ProcessConsensusChange gets called to inform Portal about the changes in the consensus set.

func (*Portal) SetAnnouncement added in v0.7.0

func (p *Portal) SetAnnouncement(text string, expires uint64) error

SetAnnouncement sets a new portal announcement.

func (*Portal) SetCredits

func (p *Portal) SetCredits(c modules.CreditData)

SetCredits updates the credit data.

Jump to

Keyboard shortcuts

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