moderation

package
v0.0.0-...-36085eb Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	LoadUserBannedFromChat(ctx context.Context, address, remoteAddress string) (bool, error)
	LoadRemoteAddressBannedFromVideoEnqueuing(ctx context.Context, remoteAddress string) (bool, error)
	LoadPaymentAddressBannedFromVideoEnqueuing(ctx context.Context, address string) (bool, error)
	LoadRemoteAddressBannedFromRewards(ctx context.Context, remoteAddress string) (bool, error)
	LoadPaymentAddressBannedFromRewards(ctx context.Context, address string) (bool, error)
	BanUser(ctx context.Context, fromChat, fromEnqueuing, fromRewards bool, until *time.Time, address, remoteAddress, reason string, moderator auth.User, moderatorUsername string) (string, error)
	RemoveBan(ctx context.Context, banID, reason string, moderator auth.User) error

	LoadPaymentAddressSkipsClientIntegrityChecks(ctx context.Context, address string) (bool, error)
	LoadPaymentAddressSkipsIPReputationChecks(ctx context.Context, address string) (bool, error)
	LoadPaymentAddressHasReducedHardChallengeFrequency(ctx context.Context, address string) (bool, error)
	VerifyUser(ctx context.Context, skipClientIntegrityChecks, skipIPAddressReputationChecks, reduceHardChallengeFrequency bool, address, reason string, moderator auth.User, moderatorUsername string) (string, error)
	RemoveVerification(ctx context.Context, verificationID, reason string, moderator auth.User) error
}

Store saves and loads moderation decisions

func NewStoreDatabase

func NewStoreDatabase(ctx context.Context) (Store, error)

type StoreDatabase

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

StoreDatabase stores moderation decisions in the database

func (*StoreDatabase) BanUser

func (m *StoreDatabase) BanUser(ctxCtx context.Context, fromChat, fromEnqueuing, fromRewards bool, until *time.Time, address, remoteAddress, reason string, moderator auth.User, moderatorUsername string) (string, error)

func (*StoreDatabase) LoadPaymentAddressBannedFromRewards

func (m *StoreDatabase) LoadPaymentAddressBannedFromRewards(ctx context.Context, address string) (bool, error)

func (*StoreDatabase) LoadPaymentAddressBannedFromVideoEnqueuing

func (m *StoreDatabase) LoadPaymentAddressBannedFromVideoEnqueuing(ctx context.Context, address string) (bool, error)

func (*StoreDatabase) LoadPaymentAddressHasReducedHardChallengeFrequency

func (m *StoreDatabase) LoadPaymentAddressHasReducedHardChallengeFrequency(ctx context.Context, address string) (bool, error)

func (*StoreDatabase) LoadPaymentAddressSkipsClientIntegrityChecks

func (m *StoreDatabase) LoadPaymentAddressSkipsClientIntegrityChecks(ctx context.Context, address string) (bool, error)

func (*StoreDatabase) LoadPaymentAddressSkipsIPReputationChecks

func (m *StoreDatabase) LoadPaymentAddressSkipsIPReputationChecks(ctx context.Context, address string) (bool, error)

func (*StoreDatabase) LoadRemoteAddressBannedFromRewards

func (m *StoreDatabase) LoadRemoteAddressBannedFromRewards(ctx context.Context, remoteAddress string) (bool, error)

func (*StoreDatabase) LoadRemoteAddressBannedFromVideoEnqueuing

func (m *StoreDatabase) LoadRemoteAddressBannedFromVideoEnqueuing(ctx context.Context, remoteAddress string) (bool, error)

func (*StoreDatabase) LoadUserBannedFromChat

func (m *StoreDatabase) LoadUserBannedFromChat(ctx context.Context, address, remoteAddress string) (bool, error)

func (*StoreDatabase) RemoveBan

func (m *StoreDatabase) RemoveBan(ctxCtx context.Context, banID, reason string, moderator auth.User) error

func (*StoreDatabase) RemoveVerification

func (m *StoreDatabase) RemoveVerification(ctxCtx context.Context, verificationID, reason string, moderator auth.User) error

func (*StoreDatabase) VerifyUser

func (m *StoreDatabase) VerifyUser(ctxCtx context.Context, skipClientIntegrityChecks, skipIPAddressReputationChecks, reduceHardChallengeFrequency bool, address, reason string, moderator auth.User, moderatorUsername string) (string, error)

type StoreNoOp

type StoreNoOp struct{}

StoreNoOp does not actually store any decisions, nobody is banned

func (*StoreNoOp) BanUser

func (*StoreNoOp) BanUser(ctx context.Context, fromChat, fromEnqueuing, fromRewards bool, until *time.Time, address, remoteAddress, reason string, moderator auth.User, moderatorUsername string) (string, error)

func (*StoreNoOp) LoadPaymentAddressBannedFromRewards

func (*StoreNoOp) LoadPaymentAddressBannedFromRewards(ctx context.Context, address string) (bool, error)

func (*StoreNoOp) LoadPaymentAddressBannedFromVideoEnqueuing

func (*StoreNoOp) LoadPaymentAddressBannedFromVideoEnqueuing(ctx context.Context, address string) (bool, error)

func (*StoreNoOp) LoadPaymentAddressHasReducedHardChallengeFrequency

func (*StoreNoOp) LoadPaymentAddressHasReducedHardChallengeFrequency(ctx context.Context, address string) (bool, error)

func (*StoreNoOp) LoadPaymentAddressSkipsClientIntegrityChecks

func (*StoreNoOp) LoadPaymentAddressSkipsClientIntegrityChecks(ctx context.Context, address string) (bool, error)

func (*StoreNoOp) LoadPaymentAddressSkipsIPReputationChecks

func (*StoreNoOp) LoadPaymentAddressSkipsIPReputationChecks(ctx context.Context, address string) (bool, error)

func (*StoreNoOp) LoadRemoteAddressBannedFromRewards

func (*StoreNoOp) LoadRemoteAddressBannedFromRewards(ctx context.Context, remoteAddress string) (bool, error)

func (*StoreNoOp) LoadRemoteAddressBannedFromVideoEnqueuing

func (*StoreNoOp) LoadRemoteAddressBannedFromVideoEnqueuing(ctx context.Context, remoteAddress string) (bool, error)

func (*StoreNoOp) LoadUserBannedFromChat

func (*StoreNoOp) LoadUserBannedFromChat(ctx context.Context, address, remoteAddress string) (bool, error)

func (*StoreNoOp) RemoveBan

func (*StoreNoOp) RemoveBan(ctx context.Context, banID, reason string, moderator auth.User) error

func (*StoreNoOp) RemoveVerification

func (*StoreNoOp) RemoveVerification(ctx context.Context, verificationID, reason string, moderator auth.User) error

func (*StoreNoOp) VerifyUser

func (*StoreNoOp) VerifyUser(ctx context.Context, skipClientIntegrityChecks, skipIPAddressReputationChecks, reduceHardChallengeFrequency bool, address, reason string, moderator auth.User, moderatorUsername string) (string, error)

Jump to

Keyboard shortcuts

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