Documentation
¶
Index ¶
- type Guard
- func (g *Guard) AllowDistribution(ctx context.Context, owner *common.Account, isPublic bool) (bool, error)
- func (g *Guard) AllowOpenAccounts(ctx context.Context, owner *common.Account, ...) (bool, error)
- func (g *Guard) AllowReceivePayments(ctx context.Context, owner *common.Account, isPublic bool) (bool, error)
- func (g *Guard) AllowSendPayment(ctx context.Context, owner, destination *common.Account, isPublic bool) (bool, error)
- func (g *Guard) AllowSwap(ctx context.Context, owner, fromMint, toMint *common.Account) (bool, error)
- func (g *Guard) AllowWelcomeBonus(ctx context.Context, owner *common.Account) (bool, error)
- type Integration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
func NewGuard ¶
func NewGuard(integration Integration) *Guard
func (*Guard) AllowDistribution ¶
func (*Guard) AllowOpenAccounts ¶
func (g *Guard) AllowOpenAccounts(ctx context.Context, owner *common.Account, accountSet transactionpb.OpenAccountsMetadata_AccountSet) (bool, error)
func (*Guard) AllowReceivePayments ¶
func (*Guard) AllowSendPayment ¶
type Integration ¶
type Integration interface {
AllowOpenAccounts(ctx context.Context, owner *common.Account, accountSet transactionpb.OpenAccountsMetadata_AccountSet) (bool, string, error)
AllowWelcomeBonus(ctx context.Context, owner *common.Account) (bool, string, error)
AllowSendPayment(ctx context.Context, owner, destination *common.Account, isPublic bool) (bool, string, error)
AllowReceivePayments(ctx context.Context, owner *common.Account, isPublic bool) (bool, string, error)
AllowDistribution(ctx context.Context, owner *common.Account, isPublic bool) (bool, string, error)
AllowSwap(ctx context.Context, owner, fromMint, toMint *common.Account) (bool, string, error)
}
Integration is an antispam guard integration that apps can implement to check whether operations of interest are allowed to be performed.
func NewAllowEverything ¶
func NewAllowEverything() Integration
NewAllowEverything returns a default antispam integration that allows everything
Click to show internal directories.
Click to hide internal directories.