Documentation
¶
Index ¶
- func GenerateKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func GenerateValidReceipt(owner ed25519.PrivateKey, message string) string
- func NewInMemory() iap.Store
- func NewMemoryVerifier(pubKey ed25519.PublicKey, validProduct string) iap.Verifier
- type InMemoryStore
- func (s *InMemoryStore) CreatePurchase(ctx context.Context, purchase *iap.Purchase) error
- func (s *InMemoryStore) GetPurchaseByID(ctx context.Context, receiptID []byte) (*iap.Purchase, error)
- func (s *InMemoryStore) GetPurchasesByUserAndProduct(ctx context.Context, userID *commonpb.UserId, product iap.Product) ([]*iap.Purchase, error)
- type MemoryVerifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeyPair ¶
func GenerateKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
func GenerateValidReceipt ¶
func GenerateValidReceipt(owner ed25519.PrivateKey, message string) string
func NewInMemory ¶
Types ¶
type InMemoryStore ¶
type InMemoryStore struct {
// contains filtered or unexported fields
}
func (*InMemoryStore) CreatePurchase ¶
func (*InMemoryStore) GetPurchaseByID ¶
type MemoryVerifier ¶
type MemoryVerifier struct {
// contains filtered or unexported fields
}
MemoryVerifier is an in-memory verifier that checks an ed25519 signature on the receipt. For testing purposes, the "receipt" is actually a message that, when signed by the owner secret, is considered valid.
func (*MemoryVerifier) GetReceiptIdentifier ¶
func (*MemoryVerifier) VerifyReceipt ¶
Click to show internal directories.
Click to hide internal directories.