licenses

package
v0.0.0-...-41355f5 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PayTypETH int = iota
	PayTypBTLC
	PayTypTRX
	PayTypTrxUsd
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FreshLicensResult

type FreshLicensResult struct {
	TxStr string `json:"tx_str"`
	License
}

func (*FreshLicensResult) Marshal

func (flr *FreshLicensResult) Marshal(key []byte) ([]byte, error)

func (*FreshLicensResult) UnMarshal

func (flr *FreshLicensResult) UnMarshal(key, data []byte) error

type FreshLicenseReq

type FreshLicenseReq struct {
	Receiver account.BeatleAddress
}

func (*FreshLicenseReq) Marshal

func (fl *FreshLicenseReq) Marshal(key []byte) ([]byte, error)

func (*FreshLicenseReq) UnMarshal

func (fl *FreshLicenseReq) UnMarshal(key, data []byte) error

type License

type License struct {
	Signature string         `json:"signature"`
	Content   LicenseContent `json:"content"`
}

func (*License) Marshal

func (l *License) Marshal(key []byte) ([]byte, error)

func (*License) String

func (l *License) String() string

func (*License) UnMarshal

func (l *License) UnMarshal(key []byte, data []byte) error

type LicenseContent

type LicenseContent struct {
	Provider   account.BeatleAddress `json:"provider"`
	Receiver   account.BeatleAddress `json:"receiver"`
	Name       string                `json:"name"`
	Email      string                `json:"email"`
	Cell       string                `json:"cell"`
	ExpireTime int64                 `json:"expire_time"`
}

type LicenseRenew

type LicenseRenew struct {
	TXSig NoncePriceSig `json:"tx_sig"`
	TxStr string        `json:"tx_str"`
	Name  string        `json:"name"`
	Email string        `json:"email"`
	Cell  string        `json:"cell"`
}

func (*LicenseRenew) Marshal

func (lr *LicenseRenew) Marshal(key []byte) ([]byte, error)

func (*LicenseRenew) String

func (lr *LicenseRenew) String() string

func (*LicenseRenew) UnMarshal

func (lr *LicenseRenew) UnMarshal(key []byte, data []byte) error

type NoncePrice

type NoncePrice struct {
	Nonce    uint64                `json:"nonce"`
	Receiver account.BeatleAddress `json:"receiver"`
	Payer    common.Address        `json:"payer"`
	PayTyp   int                   `json:"pay_typ"`
	Month    int64                 `json:"month"`
}

func (*NoncePrice) Marshal

func (np *NoncePrice) Marshal(key []byte) ([]byte, error)

func (*NoncePrice) UnMarshal

func (np *NoncePrice) UnMarshal(key []byte, data []byte) error

type NoncePriceContent

type NoncePriceContent struct {
	Nonce         uint64                `json:"nonce"`
	Receiver      account.BeatleAddress `json:"receiver"`
	Payer         common.Address        `json:"payer"`
	PricePerMonth float64               `json:"price_per_month"`
	Month         int64                 `json:"month"`
	Total         float64               `json:"total"`
	TotalPrice    float64               `json:"total_price"`
	MarketPrice   float64               `json:"market_price"`
	PayTyp        int                   `json:"pay_typ"`
}

Total = PricePerMonth * Month TotalEth = Total/EthPrice

type NoncePriceSig

type NoncePriceSig struct {
	Sig     string            `json:"sig"`
	Content NoncePriceContent `json:"content"`
}

func (*NoncePriceSig) Marshal

func (nps *NoncePriceSig) Marshal(key []byte) ([]byte, error)

func (*NoncePriceSig) Sign

func (nps *NoncePriceSig) Sign(sig func([]byte) []byte) error

func (*NoncePriceSig) String

func (nps *NoncePriceSig) String() string

func (*NoncePriceSig) UnMarshal

func (nps *NoncePriceSig) UnMarshal(key []byte, data []byte) error

func (*NoncePriceSig) ValidSig

func (nps *NoncePriceSig) ValidSig(pk ed25519.PublicKey) bool

Jump to

Keyboard shortcuts

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