globalrules

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewGlobalRule

func AddNewGlobalRule(
	time clock.TimeProvider,
	client dynamodb.TransactWriteItemsAPI,
	identifier string,
	ruleType types.RuleType,
	policy types.Policy,
	description string,
) error

func PingDatabase

func PingDatabase(client dynamodb.QueryAPI) (err error)

func RemoveGlobalRule

func RemoveGlobalRule(
	timeProvider clock.TimeProvider,
	getter dynamodb.GetItemAPI,
	transacter dynamodb.TransactWriteItemsAPI,
	ruleSortKey string,
	txnIdempotencyKey string,
) error

RemoveGlobalRule will remove the rule from the global repository of rules. It also creates a new rule entry in the feed that explicitly tells future syncs to remove the rule too.

func UpdateGlobalRule

func UpdateGlobalRule(
	time clock.TimeProvider,
	client dynamodb.TransactWriteItemsAPI,
	identifier string,
	ruleType types.RuleType,
	rulePolicy types.Policy,
) error

Types

type ConcreteGlobalRulesUpdater

type ConcreteGlobalRulesUpdater struct {
	ClockProvider clock.TimeProvider
	TransactWrite dynamodb.TransactWriteItemsAPI
}

func (ConcreteGlobalRulesUpdater) UpdateGlobalRule

func (c ConcreteGlobalRulesUpdater) UpdateGlobalRule(sha256 string, ruleType types.RuleType, rulePolicy types.Policy) (err error)

type ConcreteRuleRemovalService

type ConcreteRuleRemovalService struct {
	TimeProvider clock.TimeProvider
	Getter       dynamodb.GetItemAPI
	Transacter   dynamodb.TransactWriteItemsAPI
}

func (ConcreteRuleRemovalService) RemoveGlobalRule

func (c ConcreteRuleRemovalService) RemoveGlobalRule(ruleSortKey string, idempotencyKey string) (err error)

type GlobalRuleRow

type GlobalRuleRow struct {
	dynamodb.PrimaryKey
	rules.SantaRule
	Description string `dynamodbav:"Description,omitempty"`
}

func GetGlobalRuleByIdentifier added in v1.0.1

func GetGlobalRuleByIdentifier(client dynamodb.GetItemAPI, identifier string, ruleType types.RuleType) (*GlobalRuleRow, error)

func GetGlobalRuleByShaType

func GetGlobalRuleByShaType(client dynamodb.GetItemAPI, sha256 string, ruleType types.RuleType) (*GlobalRuleRow, error)

@deprecated Use GetGlobalRuleByIdentifier

func GetGlobalRuleBySortKey

func GetGlobalRuleBySortKey(client dynamodb.GetItemAPI, ruleSortKey string) (*GlobalRuleRow, error)

func GetPaginatedGlobalRules

func GetPaginatedGlobalRules(
	client dynamodb.QueryAPI,
	limit int,
	exclusiveStartKey *dynamodb.PrimaryKey,
) (
	items []*GlobalRuleRow,
	lastEvaluatedKey *dynamodb.PrimaryKey,
	err error,
)

type GlobalRulesUpdater

type GlobalRulesUpdater interface {
	UpdateGlobalRule(sha256 string, ruleType types.RuleType, rulePolicy types.Policy) error
}

type RuleRemovalService

type RuleRemovalService interface {
	RemoveGlobalRule(ruleSortKey string, idempotencyKey string) (err error)
}

Jump to

Keyboard shortcuts

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