models

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedSearchQuery

type AdvancedSearchQuery struct {
	Query      string        `json:"query"`
	Filters    []string      `json:"filters"`
	Limit      int           `json:"limit"`
	Start      int           `json:"start"`
	Transforms []interface{} `json:"transforms"`
	Sort       string        `json:"sort"`
	// Generous means that all of the database items are going to be filtered
	Generous bool `json:"generous"`
}

type BuyerOrder

type BuyerOrder struct {
	RefundAddress        string        `json:"refundAddress"`
	RefundFee            int64         `json:"refundFee"`
	Shipping             Shipping      `json:"shipping"`
	BuyerID              RID           `json:"buyerID"`
	Timestamp            string        `json:"timestamp"`
	Items                []ItemElement `json:"items"`
	Payment              Payment       `json:"payment"`
	RatingKeys           []string      `json:"ratingKeys"`
	AlternateContactInfo string        `json:"alternateContactInfo"`
	Version              int64         `json:"version"`
}

type BuyerOrderCompletion

type BuyerOrderCompletion struct {
	OrderID   string   `json:"orderId"`
	Timestamp string   `json:"timestamp"`
	Ratings   []Rating `json:"ratings"`
}

type BuyerRating

type BuyerRating struct {
	VendorID string  `json:"vendorID"`
	Comment  string  `json:"comment"`
	Fields   []Field `json:"fields"`
}

type Contract

type Contract struct {
	Contract                   ContractClass               `json:"contract"`
	State                      string                      `json:"state"`
	Read                       bool                        `json:"read"`
	Funded                     bool                        `json:"funded"`
	UnreadChatMessages         int64                       `json:"unreadChatMessages"`
	PaymentAddressTransactions []PaymentAddressTransaction `json:"paymentAddressTransactions"`
}

func UnmarshalContract

func UnmarshalContract(data []byte) (Contract, error)

func (*Contract) Marshal

func (r *Contract) Marshal() ([]byte, error)

type ContractClass

type ContractClass struct {
	VendorListings          []VendorListing          `json:"vendorListings"`
	BuyerOrder              BuyerOrder               `json:"buyerOrder"`
	VendorOrderConfirmation VendorOrderConfirmation  `json:"vendorOrderConfirmation"`
	VendorOrderFulfillment  []VendorOrderFulfillment `json:"vendorOrderFulfillment"`
	BuyerOrderCompletion    BuyerOrderCompletion     `json:"buyerOrderCompletion"`
	Signatures              []Signature              `json:"signatures"`
}

type Coupon

type Coupon struct {
	Title           string `json:"title"`
	Hash            string `json:"hash"`
	PercentDiscount int64  `json:"percentDiscount"`
}

type Field

type Field struct {
	Type   string `json:"type"`
	Score  int64  `json:"score"`
	Max    int64  `json:"max"`
	Weight int64  `json:"weight"`
}

type IPFSListing

type IPFSListing struct {
	Listing   ListingClass `json:"listing"`
	Signature string       `json:"signature"`
}

type Image

type Image struct {
	Filename string `json:"filename"`
	Original string `json:"original"`
	Large    string `json:"large"`
	Medium   string `json:"medium"`
	Small    string `json:"small"`
	Tiny     string `json:"tiny"`
}

type Item

type Item struct {
	Title          string   `json:"title"`
	Description    string   `json:"description"`
	ProcessingTime string   `json:"processingTime"`
	Price          int64    `json:"price"`
	Tags           []string `json:"tags"`
	Images         []Image  `json:"images"`
	Categories     []string `json:"categories"`
	Condition      string   `json:"condition"`
	Options        []Option `json:"options"`
	Skus           []Skus   `json:"skus"`
}

type ItemElement

type ItemElement struct {
	ListingHash    string         `json:"listingHash"`
	Quantity       int64          `json:"quantity"`
	Quantity64     int64          `json:"quantity64"`
	ShippingOption ShippingOption `json:"shippingOption"`
	Memo           string         `json:"memo"`
	PaymentAddress string         `json:"paymentAddress"`
}

type Listing

type Listing struct {
	Slug          string    `json:"slug"`
	AverageRating int64     `json:"averageRating"`
	Hash          string    `json:"hash"`
	Language      string    `json:"language"`
	Nsfw          bool      `json:"nsfw"`
	RatingCount   int64     `json:"ratingCount"`
	Thumbnail     Thumbnail `json:"thumbnail"`
	PeerSlug      string    `json:"peerSlug"`
	ParentPeer    string    `json:"parentPeer"`
	Location      Location  `json:"location"`
}

type ListingClass

type ListingClass struct {
	Slug               string           `json:"slug"`
	VendorID           VendorID         `json:"vendorID"`
	Metadata           Metadata         `json:"metadata"`
	Item               Item             `json:"item"`
	ShippingOptions    []ShippingOption `json:"shippingOptions"`
	Taxes              []interface{}    `json:"taxes"`
	Coupons            []interface{}    `json:"coupons"`
	Moderators         []string         `json:"moderators"`
	TermsAndConditions string           `json:"termsAndConditions"`
	RefundPolicy       string           `json:"refundPolicy"`

	AverageRating int64     `json:"averageRating"`
	Hash          string    `json:"hash"`
	Language      string    `json:"language"`
	Nsfw          bool      `json:"nsfw"`
	RatingCount   int64     `json:"ratingCount"`
	Thumbnail     Thumbnail `json:"thumbnail"`
	PeerSlug      string    `json:"peerSlug"`
	ParentPeer    string    `json:"parentPeer"`
	Location      Location  `json:"location"`
}

type Location

type Location struct {
	Latitude   string `json:"latitude"`
	Longitude  string `json:"longitude"`
	PlusCode   string `json:"plusCode"`
	AddressOne string `json:"addressOne"`
	AddressTwo string `json:"addressTwo"`
	City       string `json:"city"`
	State      string `json:"state"`
	Country    string `json:"country"`
	ZipCode    string `json:"zipCode"`
}

type Metadata

type Metadata struct {
	Version               int64    `json:"version"`
	ContractType          string   `json:"contractType"`
	Format                string   `json:"format"`
	Expiry                string   `json:"expiry"`
	AcceptedCurrencies    []string `json:"acceptedCurrencies"`
	PricingCurrency       string   `json:"pricingCurrency"`
	EscrowTimeoutHours    int64    `json:"escrowTimeoutHours"`
	ServiceRateMethod     string   `json:"serviceRateMethod"`
	ServiceClassification string   `json:"serviceClassification"`
}

type OldListing

type OldListing struct {
	AcceptedCurrencies []string      `json:"acceptedCurrencies"`
	AverageRating      int64         `json:"averageRating"`
	Categories         []string      `json:"categories"`
	ContractType       string        `json:"contractType"`
	Description        string        `json:"description"`
	Hash               string        `json:"hash"`
	Language           string        `json:"language"`
	Location           Location      `json:"location"`
	Moderators         []interface{} `json:"moderators"`
	Nsfw               bool          `json:"nsfw"`
	Price              Price         `json:"price"`
	RatingCount        int64         `json:"ratingCount"`
	Slug               string        `json:"slug"`
	Thumbnail          Thumbnail     `json:"thumbnail"`
	Title              string        `json:"title"`
}

type Option

type Option struct {
	Name     string    `json:"name"`
	Variants []Variant `json:"variants"`
}

type Payment

type Payment struct {
	Method       string `json:"method"`
	Moderator    string `json:"moderator"`
	Amount       int64  `json:"amount"`
	Chaincode    string `json:"chaincode"`
	Address      string `json:"address"`
	RedeemScript string `json:"redeemScript"`
	Coin         string `json:"coin"`
}

type PaymentAddressTransaction

type PaymentAddressTransaction struct {
	Txid          string `json:"txid"`
	Value         int64  `json:"value"`
	Confirmations int64  `json:"confirmations"`
	Height        int64  `json:"height"`
	Timestamp     string `json:"timestamp"`
}

type Peer

type Peer struct {
	ID       string                 `json:"peerID"`
	RawMap   map[string]interface{} `json:"profile"`
	LastPing int64                  `json:"lastPing"`
}

type Price

type Price struct {
	Amount       int64  `json:"amount"`
	CurrencyCode string `json:"currencyCode"`
	Modifier     int64  `json:"modifier"`
}

type PubKeys

type PubKeys struct {
	Identity string `json:"identity"`
	// contains filtered or unexported fields
}

type Pubkeys

type Pubkeys struct {
	Identity string `json:"identity"`
	Bitcoin  string `json:"bitcoin"`
}

type RID

type RID struct {
	PeerID     string  `json:"peerID"`
	Handle     string  `json:"handle"`
	Pubkeys    Pubkeys `json:"pubkeys"`
	BitcoinSig string  `json:"bitcoinSig"`
}

type Rating

type Rating struct {
	RatingData RatingData `json:"ratingData"`
	Signature  string     `json:"signature"`
}

type RatingData

type RatingData struct {
	RatingKey       string          `json:"ratingKey"`
	VendorID        RID             `json:"vendorID"`
	VendorSig       RatingSignature `json:"vendorSig"`
	BuyerID         RID             `json:"buyerID"`
	BuyerName       string          `json:"buyerName"`
	BuyerSig        string          `json:"buyerSig"`
	Timestamp       string          `json:"timestamp"`
	Overall         int64           `json:"overall"`
	Quality         int64           `json:"quality"`
	Description     int64           `json:"description"`
	DeliverySpeed   int64           `json:"deliverySpeed"`
	CustomerService int64           `json:"customerService"`
	Review          string          `json:"review"`
}

type RatingSignature

type RatingSignature struct {
	Metadata  RatingSignatureMetadata `json:"metadata"`
	Signature string                  `json:"signature"`
}

type RatingSignatureMetadata

type RatingSignatureMetadata struct {
	ListingSlug  string `json:"listingSlug"`
	RatingKey    string `json:"ratingKey"`
	ListingTitle string `json:"listingTitle"`
	Thumbnail    Image  `json:"thumbnail"`
}

type Service

type Service struct {
	Name                string `json:"name"`
	EstimatedDelivery   string `json:"estimatedDelivery"`
	Price               *int64 `json:"price,omitempty"`
	AdditionalItemPrice *int64 `json:"additionalItemPrice,omitempty"`
}

type Shipping

type Shipping struct {
	ShipTo       string `json:"shipTo"`
	Address      string `json:"address"`
	City         string `json:"city"`
	State        string `json:"state"`
	PostalCode   string `json:"postalCode"`
	Country      string `json:"country"`
	AddressNotes string `json:"addressNotes"`
}

type ShippingOption

type ShippingOption struct {
	Name     string    `json:"name"`
	Type     string    `json:"type"`
	Regions  []string  `json:"regions"`
	Services []Service `json:"services"`
}

type Signature

type Signature struct {
	Section        string `json:"section"`
	SignatureBytes string `json:"signatureBytes"`
}

type Skus

type Skus struct {
	ProductID string `json:"productID"`
	Quantity  int64  `json:"quantity"`
}

type Thumbnail

type Thumbnail struct {
	Medium string `json:"medium"`
	Small  string `json:"small"`
	Tiny   string `json:"tiny"`
}

type Variant

type Variant struct {
	Name string `json:"name"`
}

type VendorID

type VendorID struct {
	PeerID     string  `json:"peerID"`
	Pubkeys    Pubkeys `json:"pubkeys"`
	BitcoinSig string  `json:"bitcoinSig"`
}

type VendorListing

type VendorListing struct {
	Slug               string                `json:"slug"`
	VendorID           RID                   `json:"vendorID"`
	Metadata           VendorListingMetadata `json:"metadata"`
	Item               VendorListingItem     `json:"item"`
	ShippingOptions    []interface{}         `json:"shippingOptions"`
	Coupons            []Coupon              `json:"coupons"`
	Moderators         []interface{}         `json:"moderators"`
	TermsAndConditions string                `json:"termsAndConditions"`
	RefundPolicy       string                `json:"refundPolicy"`
	Location           Location              `json:"location"`
}

type VendorListingItem

type VendorListingItem struct {
	Title          string        `json:"title"`
	Description    string        `json:"description"`
	ProcessingTime string        `json:"processingTime"`
	Price          int64         `json:"price"`
	Nsfw           bool          `json:"nsfw"`
	Tags           []string      `json:"tags"`
	Images         []Image       `json:"images"`
	Categories     []string      `json:"categories"`
	Grams          int64         `json:"grams"`
	Condition      string        `json:"condition"`
	Options        []interface{} `json:"options"`
	Skus           []Skus        `json:"skus"`
}

type VendorListingMetadata

type VendorListingMetadata struct {
	Version               int64    `json:"version"`
	ContractType          string   `json:"contractType"`
	Format                string   `json:"format"`
	Expiry                string   `json:"expiry"`
	AcceptedCurrencies    []string `json:"acceptedCurrencies"`
	PricingCurrency       string   `json:"pricingCurrency"`
	Language              string   `json:"language"`
	EscrowTimeoutHours    int64    `json:"escrowTimeoutHours"`
	CoinType              string   `json:"coinType"`
	CoinDivisibility      int64    `json:"coinDivisibility"`
	PriceModifier         int64    `json:"priceModifier"`
	ServiceRateMethod     string   `json:"serviceRateMethod"`
	ServiceClassification string   `json:"serviceClassification"`
}

type VendorOrderConfirmation

type VendorOrderConfirmation struct {
	OrderID         string `json:"orderID"`
	Timestamp       string `json:"timestamp"`
	PaymentAddress  string `json:"paymentAddress"`
	RequestedAmount int64  `json:"requestedAmount"`
}

type VendorOrderFulfillment

type VendorOrderFulfillment struct {
	OrderID         string          `json:"orderId"`
	Slug            string          `json:"slug"`
	Timestamp       string          `json:"timestamp"`
	RatingSignature RatingSignature `json:"ratingSignature"`
	Note            string          `json:"note"`
	BuyerRating     BuyerRating     `json:"buyerRating"`
}

Jump to

Keyboard shortcuts

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