policy

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

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

func New

func New(cfg config.Policy) (*Policy, error)

func (*Policy) Allow added in v0.2.0

func (p *Policy) Allow(peerID peer.ID) bool

Allow alters the policy to allow the specified peer. Returns true if the policy needed to be updated.

func (*Policy) Allowed

func (p *Policy) Allowed(peerID peer.ID) bool

Allowed returns true if the policy allows the peer to index content.

func (*Policy) Block added in v0.2.0

func (p *Policy) Block(peerID peer.ID) bool

Block alters the policy to not allow the specified peer. Returns true if the policy needed to be updated.

func (*Policy) Config added in v0.2.0

func (p *Policy) Config(cfg config.Policy) error

Config applies the configuration.

func (*Policy) PublishAllowed added in v0.4.7

func (p *Policy) PublishAllowed(publisherID, providerID peer.ID) bool

PublishAllowed returns true if policy allows the publisher to publish advertisements for the identified provider. This assumes that both are already allowed by policy.

func (*Policy) RateLimited added in v0.4.7

func (p *Policy) RateLimited(peerID peer.ID) bool

RateLimited determines if the peer is rate limited.

func (*Policy) ToConfig added in v0.2.0

func (p *Policy) ToConfig() config.Policy

ToConfig converts a Policy into a config.Policy.

Jump to

Keyboard shortcuts

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