Documentation ¶
Index ¶
- type Policy
- func (p *Policy) Allow(peerID peer.ID) bool
- func (p *Policy) Allowed(peerID peer.ID) bool
- func (p *Policy) Block(peerID peer.ID) bool
- func (p *Policy) Config(cfg config.Policy) error
- func (p *Policy) PublishAllowed(publisherID, providerID peer.ID) bool
- func (p *Policy) RateLimited(peerID peer.ID) bool
- func (p *Policy) ToConfig() config.Policy
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 (*Policy) Allow ¶ added in v0.2.0
Allow alters the policy to allow the specified peer. Returns true if the policy needed to be updated.
func (*Policy) Block ¶ added in v0.2.0
Block alters the policy to not allow the specified peer. Returns true if the policy needed to be updated.
func (*Policy) PublishAllowed ¶ added in v0.4.7
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
RateLimited determines if the peer is rate limited.
Click to show internal directories.
Click to hide internal directories.