memory

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

func NewInMemory() iap.Store

func NewMemoryVerifier

func NewMemoryVerifier(pubKey ed25519.PublicKey) iap.Verifier

NewMemoryVerifier creates a new MemoryVerifier from a given public key.

Types

type InMemoryStore

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

func (*InMemoryStore) CreatePurchase

func (s *InMemoryStore) CreatePurchase(ctx context.Context, purchase *iap.Purchase) error

func (*InMemoryStore) GetPurchase

func (s *InMemoryStore) GetPurchase(ctx context.Context, receiptID []byte) (*iap.Purchase, error)

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 (m *MemoryVerifier) GetReceiptIdentifier(ctx context.Context, receipt string) ([]byte, error)

func (*MemoryVerifier) VerifyReceipt

func (m *MemoryVerifier) VerifyReceipt(ctx context.Context, receipt string) (bool, error)

Jump to

Keyboard shortcuts

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