barter

package
v0.0.0-...-0e0a2a2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTraderToken

func GenerateTraderToken(trader Trader, signingKey []byte, expiryDuration time.Duration, issuer string) (string, common.Error)

Types

type Good

type Good struct {
	ID        int
	Name      string
	OwnerID   int
	CreatedAt time.Time
	UpdatedAt time.Time
}

func ExchangeGoods

func ExchangeGoods(requestGood Good, targetGood Good) []Good

func NewGood

func NewGood(trader Trader, goodName string) Good

func (*Good) IsMyGood

func (d *Good) IsMyGood(trader Trader) bool

type Trader

type Trader struct {
	ID        int
	UID       string
	Email     string
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewTrader

func NewTrader(uid string, email string, name string) Trader

func ParseTraderFromToken

func ParseTraderFromToken(signedToken string, signingKey []byte) (*Trader, common.Error)

Jump to

Keyboard shortcuts

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