Model

package
v0.0.0-...-58228e6 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BUYERS_ENDPOINT = "https://kqxty15mpg.execute-api.us-east-1.amazonaws.com/buyers?date="
View Source
const PRODUCTS_ENDPOINT = "https://kqxty15mpg.execute-api.us-east-1.amazonaws.com/products?date="
View Source
const TRANSACTIONS_ENDPOINT = "https://kqxty15mpg.execute-api.us-east-1.amazonaws.com/transactions?date="

Variables

This section is empty.

Functions

func GetBuyers

func GetBuyers(date string) (interface{}, error)

func GetProducts

func GetProducts(date string) (interface{}, error)

func GetTransactions

func GetTransactions(date string) (interface{}, error)

func ListBuyers

func ListBuyers() (interface{}, error)

Types

type Buyer

type Buyer struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
	Age  int    `json:"age,omitempty"`
}

type BuyerID

type BuyerID struct {
	ID string `json:"id,omitempty"`
}

type BuyerName

type BuyerName struct {
	Name string `json:"name,omitempty"`
}

type Product

type Product struct {
	ID    string `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
	Price int    `json:"price,omitempty"`
}

type ProductID

type ProductID struct {
	ID string `json:"id,omitempty"`
}

type ProductNames

type ProductNames struct {
	Name string `json:"name,omitempty"`
}

type ProductTransactions

type ProductTransactions struct {
	Transactions []TransactionProducts `json:"transactions,omitempty"`
}

type QueryBuyer

type QueryBuyer struct {
	Buyer SimpleBuyer `json:"getBuyer,omitempty"`
}

func GetBuyer

func GetBuyer(id string) (QueryBuyer, []string, []string, error)

type QueryTransaction

type QueryTransaction struct {
	Buyers []TransactionBuyer `json:"queryTransaction,omitempty"`
}

type SimpleBuyer

type SimpleBuyer struct {
	Name         string              `json:"name,omitempty"`
	Age          int                 `json:"age,omitempty"`
	Transactions []SimpleTransaction `json:"transactions,omitempty"`
}

type SimpleTransaction

type SimpleTransaction struct {
	IP       string    `json:"ip,omitempty"`
	Products []Product `json:"products,omitempty"`
}

type Transaction

type Transaction struct {
	ID       string      `json:"id,omitempty"`
	Buyer    BuyerID     `json:"buyer,omitempty"`
	IP       string      `json:"ip,omitempty"`
	Device   string      `json:"device,omitempty"`
	Products []ProductID `json:"products,omitempty"`
}

type TransactionBuyer

type TransactionBuyer struct {
	Buyer BuyerName `json:"buyer,omitempty"`
}

type TransactionProducts

type TransactionProducts struct {
	Products []ProductNames `json:"products,omitempty"`
}

Jump to

Keyboard shortcuts

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