policy

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 1

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(allow bool, except []string) (*Policy, error)

func (*Policy) Allow

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 sync content.

func (*Policy) Block

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) Copy

func (p *Policy) Copy(other *Policy)

Copy copies another policy.

func (*Policy) ToConfig

func (p *Policy) ToConfig() (bool, []string)

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