Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerInfo ¶
type ConsumerInfo struct { // TODO Should not use internal structures for transport IssuerID identity.Identity `json:"issuerID"` HermesID identity.Identity `json:"hermesID"` PaymentVersion PaymentVersion `json:"paymentVersion"` }
ConsumerInfo represents the consumer related information
type CreateRequest ¶
type CreateRequest struct { ProposalID int `json:"proposal_id"` Config json.RawMessage `json:"config"` ConsumerInfo *ConsumerInfo `json:"consumer_info,omitempty"` }
CreateRequest structure represents message from service consumer to initiate session for given proposal id
type CreateResponse ¶
type CreateResponse struct { Success bool `json:"success"` Message string `json:"message"` Session SessionDto `json:"session"` PaymentInfo PaymentInfo `json:"paymentInfo"` }
CreateResponse structure represents service provider response to given session request from consumer
type PaymentInfo ¶
type PaymentInfo struct {
Supports string `json:"supported"`
}
PaymentInfo represents the payment version information
type PaymentVersion ¶
type PaymentVersion string
PaymentVersion represents the different payment versions we have
const PaymentVersionV3 PaymentVersion = "v3"
PaymentVersionV3 represents the new pingpong version
type SessionDto ¶
type SessionDto struct { ID ID `json:"id"` Config json.RawMessage `json:"config"` }
SessionDto structure represents session information data within session creation response (session id and configuration options for underlying service type)
type TimeTracker ¶
type TimeTracker struct {
// contains filtered or unexported fields
}
TimeTracker tracks elapsed time from the beginning of the session it's passive (no internal go routines) and simply encapsulates time operation: now - startOfSession expressed as duration
func NewTracker ¶
func NewTracker(getTime func() mbtime.Time) TimeTracker
NewTracker initializes TimeTracker with specified monotonically increasing clock function (usually time.Now is enough - but we do DI for test sake)
func (TimeTracker) Elapsed ¶
func (tt TimeTracker) Elapsed() time.Duration
Elapsed gets the total duration of time that has passed since we've started
func (*TimeTracker) StartTracking ¶
func (tt *TimeTracker) StartTracking()
StartTracking starts tracking the time