Documentation ¶
Index ¶
- func Wrapper(r resolver.Resolver, prefix string) api.Wrapper
- type BlockList
- type InMemoryBlockList
- func (i *InMemoryBlockList) Add(ctx context.Context, id, namespace string) error
- func (i *InMemoryBlockList) IsBlocked(ctx context.Context, id, namespace string) (bool, error)
- func (i *InMemoryBlockList) List(ctx context.Context) ([]string, error)
- func (i *InMemoryBlockList) Remove(ctx context.Context, id, namespace string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockList ¶
type BlockList interface { // IsBlocked returns true if the id is blocked IsBlocked(ctx context.Context, id, namespace string) (bool, error) // Add adds an ID to the blocklist Add(ctx context.Context, id, namespace string) error // Remove removes an ID from the blocklist Remove(ctx context.Context, id, namespace string) error // List returns the entire list of blocked IDs List(ctx context.Context) ([]string, error) }
BlockList manages a list of blocked IDs.
var DefaultBlockList BlockList = &InMemoryBlockList{ blocked: map[string]bool{}, }
type InMemoryBlockList ¶
InMemoryBlockList is an implementation of BlockList that maintains the list in memory only.
func (*InMemoryBlockList) Add ¶
func (i *InMemoryBlockList) Add(ctx context.Context, id, namespace string) error
Click to show internal directories.
Click to hide internal directories.