Documentation
¶
Index ¶
- Constants
- func SetShareTargetURLs(appURL, targetHost, paymentURL, shipmentURL string) error
- type Category
- type Item
- type ItemDetail
- type ItemSimple
- type Session
- func (s *Session) Bump(ctx context.Context, itemID int64) (int64, error)
- func (s *Session) Buy(ctx context.Context, itemID int64, token string) (int64, error)
- func (s *Session) BuyWithFailed(ctx context.Context, itemID int64, token string, expectedStatus int, ...) error
- func (s *Session) BuyWithFailedOnCampaign(ctx context.Context, itemID int64, token string) error
- func (s *Session) BuyWithMayFail(ctx context.Context, itemID int64, token string) (int64, error)
- func (s *Session) BuyWithWrongCSRFToken(ctx context.Context, itemID int64, token string) error
- func (s *Session) Complete(ctx context.Context, itemID int64) error
- func (s *Session) DecodeQRURLWithFailed(ctx context.Context, apath string, expectedStatus int) error
- func (s *Session) Do(req *http.Request) (*http.Response, error)
- func (s *Session) DownloadItemImageURL(ctx context.Context, apath string) (md5Str string, err error)
- func (s *Session) DownloadQRURL(ctx context.Context, apath string) (md5Str string, err error)
- func (s *Session) DownloadStaticURL(ctx context.Context, apath string) (md5Str string, err error)
- func (s *Session) Initialize(ctx context.Context, paymentServiceURL, shipmentServiceURL string) (int, string, error)
- func (s *Session) Item(ctx context.Context, itemID int64) (item ItemDetail, err error)
- func (s *Session) ItemEdit(ctx context.Context, itemID int64, price int) (int, error)
- func (s *Session) ItemEditWithNotOnSale(ctx context.Context, itemID int64, price int) error
- func (s *Session) Login(ctx context.Context, accountName, password string) (*asset.AppUser, error)
- func (s *Session) LoginWithWrongPassword(ctx context.Context, accountName, password string) error
- func (s *Session) NewCategoryItems(ctx context.Context, rootCategoryID int) (hasNext bool, rootCategoryName string, items []ItemSimple, err error)
- func (s *Session) NewCategoryItemsWithItemIDAndCreatedAt(ctx context.Context, rootCategoryID int, itemID, createdAt int64) (hasNext bool, rootCategoryName string, items []ItemSimple, err error)
- func (s *Session) NewItems(ctx context.Context) (hasNext bool, items []ItemSimple, err error)
- func (s *Session) NewItemsWithItemIDAndCreatedAt(ctx context.Context, itemID, createdAt int64) (hasNext bool, items []ItemSimple, err error)
- func (s *Session) Reports(ctx context.Context) (transactionEvidences []TransactionEvidence, err error)
- func (s *Session) Sell(ctx context.Context, fileName, name string, price int, description string, ...) (int64, error)
- func (s *Session) SellWithWrongCSRFToken(ctx context.Context, fileName, name string, price int, description string, ...) error
- func (s *Session) SellWithWrongPrice(ctx context.Context, fileName, name string, price int, description string, ...) error
- func (s *Session) SetSettings(ctx context.Context) error
- func (s *Session) Ship(ctx context.Context, itemID int64) (reserveID, apath string, err error)
- func (s *Session) ShipDone(ctx context.Context, itemID int64) error
- func (s *Session) ShipDoneWithFailed(ctx context.Context, itemID int64, expectedStatus int, expectedMsg string) error
- func (s *Session) ShipDoneWithWrongCSRFToken(ctx context.Context, itemID int64) error
- func (s *Session) ShipWithFailed(ctx context.Context, itemID int64, expectedStatus int, expectedMsg string) error
- func (s *Session) ShipWithWrongCSRFToken(ctx context.Context, itemID int64) error
- func (s *Session) UserItems(ctx context.Context, userID int64) (hasNext bool, user *UserSimple, items []ItemSimple, err error)
- func (s *Session) UserItemsWithItemIDAndCreatedAt(ctx context.Context, userID, itemID, createdAt int64) (hasNext bool, user *UserSimple, items []ItemSimple, err error)
- func (s *Session) UsersTransactions(ctx context.Context) (hasNext bool, items []ItemDetail, err error)
- func (s *Session) UsersTransactionsWithItemIDAndCreatedAt(ctx context.Context, itemID, createdAt int64) (hasNext bool, items []ItemDetail, err error)
- type Shipping
- type TargetURLs
- type TransactionEvidence
- type User
- type UserSimple
Constants ¶
View Source
const ( ItemMinPrice = 100 ItemMaxPrice = 1000000 ItemPriceErrMsg = "商品価格は100イスコイン以上、1,000,000イスコイン以下にしてください" )
View Source
const (
DefaultAPITimeout = 10
)
Variables ¶
This section is empty.
Functions ¶
func SetShareTargetURLs ¶
Types ¶
type Item ¶
type Item struct { ID int64 `json:"id" db:"id"` SellerID int64 `json:"seller_id" db:"seller_id"` BuyerID int64 `json:"buyer_id" db:"buyer_id"` Status string `json:"status" db:"status"` Name string `json:"name" db:"name"` Price int `json:"price" db:"price"` Description string `json:"description" db:"description"` ImageName string `json:"image_name" db:"image_name"` CategoryID int `json:"category_id" db:"category_id"` CreatedAt time.Time `json:"-" db:"created_at"` UpdatedAt time.Time `json:"-" db:"updated_at"` }
type ItemDetail ¶
type ItemDetail struct { ID int64 `json:"id"` SellerID int64 `json:"seller_id"` Seller *UserSimple `json:"seller"` BuyerID int64 `json:"buyer_id,omitempty"` Buyer *UserSimple `json:"buyer,omitempty"` Status string `json:"status"` Name string `json:"name"` Price int `json:"price"` Description string `json:"description"` ImageURL string `json:"image_url"` CategoryID int `json:"category_id"` Category *Category `json:"category"` TransactionEvidenceID int64 `json:"transaction_evidence_id,omitempty"` TransactionEvidenceStatus string `json:"transaction_evidence_status,omitempty"` ShippingStatus string `json:"shipping_status,omitempty"` CreatedAt int64 `json:"created_at"` }
type ItemSimple ¶
type ItemSimple struct { ID int64 `json:"id"` SellerID int64 `json:"seller_id"` Seller *UserSimple `json:"seller"` Status string `json:"status"` Name string `json:"name"` Price int `json:"price"` ImageURL string `json:"image_url"` CategoryID int `json:"category_id"` Category *Category `json:"category"` CreatedAt int64 `json:"created_at"` }
type Session ¶
type Session struct { UserID int64 // contains filtered or unexported fields }
func NewSession ¶
func NewSessionForInialize ¶
func (*Session) BuyWithFailed ¶
func (*Session) BuyWithFailedOnCampaign ¶
func (*Session) BuyWithMayFail ¶
人気者出品用。成功するかもしれないし、失敗するかもしれない。 この中では異質だが正常系ではあるのでここで定義する
func (*Session) BuyWithWrongCSRFToken ¶
func (*Session) DecodeQRURLWithFailed ¶
func (*Session) DownloadItemImageURL ¶
func (*Session) DownloadQRURL ¶
func (*Session) DownloadStaticURL ¶
func (*Session) Initialize ¶
func (*Session) ItemEditWithNotOnSale ¶
func (*Session) LoginWithWrongPassword ¶
func (*Session) NewCategoryItems ¶
func (*Session) NewCategoryItemsWithItemIDAndCreatedAt ¶
func (*Session) NewItemsWithItemIDAndCreatedAt ¶
func (*Session) Reports ¶
func (s *Session) Reports(ctx context.Context) (transactionEvidences []TransactionEvidence, err error)
func (*Session) SellWithWrongCSRFToken ¶
func (*Session) SellWithWrongPrice ¶
func (*Session) ShipDoneWithFailed ¶
func (*Session) ShipDoneWithWrongCSRFToken ¶
func (*Session) ShipWithFailed ¶
func (*Session) ShipWithWrongCSRFToken ¶
func (*Session) UserItems ¶
func (s *Session) UserItems(ctx context.Context, userID int64) (hasNext bool, user *UserSimple, items []ItemSimple, err error)
func (*Session) UserItemsWithItemIDAndCreatedAt ¶
func (s *Session) UserItemsWithItemIDAndCreatedAt(ctx context.Context, userID, itemID, createdAt int64) (hasNext bool, user *UserSimple, items []ItemSimple, err error)
func (*Session) UsersTransactions ¶
func (*Session) UsersTransactionsWithItemIDAndCreatedAt ¶
type Shipping ¶
type Shipping struct { TransactionEvidenceID int64 `json:"transaction_evidence_id" db:"transaction_evidence_id"` Status string `json:"status" db:"status"` ItemName string `json:"item_name" db:"item_name"` ItemID int64 `json:"item_id" db:"item_id"` ReserveID string `json:"reserve_id" db:"reserve_id"` ReserveTime int64 `json:"reserve_time" db:"reserve_time"` ToAddress string `json:"to_address" db:"to_address"` ToName string `json:"to_name" db:"to_name"` FromAddress string `json:"from_address" db:"from_address"` FromName string `json:"from_name" db:"from_name"` ImgBinary []byte `json:"-" db:"img_binary"` CreatedAt time.Time `json:"-" db:"created_at"` UpdatedAt time.Time `json:"-" db:"updated_at"` }
type TargetURLs ¶
var (
)type TransactionEvidence ¶
type TransactionEvidence struct { ID int64 `json:"id" db:"id"` SellerID int64 `json:"seller_id" db:"seller_id"` BuyerID int64 `json:"buyer_id" db:"buyer_id"` Status string `json:"status" db:"status"` ItemID int64 `json:"item_id" db:"item_id"` ItemName string `json:"item_name" db:"item_name"` ItemPrice int `json:"item_price" db:"item_price"` ItemDescription string `json:"item_description" db:"item_description"` ItemCategoryID int `json:"item_category_id" db:"item_category_id"` ItemRootCategoryID int `json:"item_root_category_id" db:"item_root_category_id"` }
type User ¶
type User struct { ID int64 `json:"id" db:"id"` AccountName string `json:"account_name" db:"account_name"` HashedPassword []byte `json:"-" db:"hashed_password"` Address string `json:"address,omitempty" db:"address"` NumSellItems int `json:"num_sell_items" db:"num_sell_items"` LastBump time.Time `json:"-" db:"last_bump"` CreatedAt time.Time `json:"-" db:"created_at"` }
type UserSimple ¶
Click to show internal directories.
Click to hide internal directories.