server

package
v0.0.0-...-00ee4c7 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsucariAPIKey = "a15400e46c83635eb181-946abb51ff26a868317c"
	IsucariShopID = "11"
)
View Source
const (
	StatusInitial    = "initial"
	StatusWaitPickup = "wait_pickup"
	StatusShipping   = "shipping"
	StatusDone       = "done"

	IsucariAPIToken = "Bearer 75ugk2m37a750fwir5xr-22l6h4wmue1bwrubzwd0"
)

Variables

View Source
var (
	SecretSeed = []byte("secret-seed")
)

Functions

func NewShipmentStore

func NewShipmentStore() *shipmentStore

func RunServer

func RunServer(paymentPort, shipmentPort int, dataDir string, allowedIPs []net.IP) (*ServerPayment, *ServerShipment, error)

Types

type Adapter

type Adapter func(http.Handler) http.Handler

type AppShipping

type AppShipping struct {
	TransactionEvidenceID int64  `json:"transaction_evidence_id" db:"transaction_evidence_id"`
	Status                string `json:"status" db:"status"`
	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"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (*Server) GetDelay

func (s *Server) GetDelay() time.Duration

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) SetDelay

func (s *Server) SetDelay(d time.Duration)

type ServerPayment

type ServerPayment struct {
	Server
	// contains filtered or unexported fields
}

func NewPayment

func NewPayment(allowedIPs []net.IP) *ServerPayment

func (*ServerPayment) ForceReportsSetStatus

func (s *ServerPayment) ForceReportsSetStatus(itemID int64, status string)

ForceReportsSetStatus is the function for benchmarker

func (*ServerPayment) ForceSet

func (s *ServerPayment) ForceSet(card string, itemID int64, price int) string

ForceSet is the function for benchmarker

func (*ServerPayment) GetReports

func (s *ServerPayment) GetReports() map[int64]report

GetReports is the function for benchmarker コピーはしていないので注意

type ServerShipment

type ServerShipment struct {
	Server
	// contains filtered or unexported fields
}

func NewShipment

func NewShipment(debug bool, dataDir string, allowedIPs []net.IP) *ServerShipment

func (*ServerShipment) CheckQRMD5

func (s *ServerShipment) CheckQRMD5(key string, md5Str string) bool

func (*ServerShipment) ForceSetStatus

func (s *ServerShipment) ForceSetStatus(key string, status string) bool

Jump to

Keyboard shortcuts

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