Versions in this module Expand all Collapse all v0 v0.0.16 Aug 20, 2024 Changes in this version + var ErrHeaderNotFound = errors.New("header not found") + var SafeCids = map[cid.Cid]string + func GetDenylistFiles() ([]string, error) + func GetDenylistFilesInDir(dirpath string) ([]string, error) + type BlockedPath struct + Path string + Prefix bool + func NewBlockedPath(rawPath string) (BlockedPath, error) + func (bpath BlockedPath) Matches(path string) bool + type Blocker struct + Denylists map[string]*Denylist + func NewBlocker(files []string) (*Blocker, error) + func (blocker *Blocker) Close() error + func (blocker *Blocker) IsCidBlocked(c cid.Cid) StatusResponse + func (blocker *Blocker) IsPathBlocked(p path.Path) StatusResponse + type BlocksDB struct + func (b *BlocksDB) Load(key string) (Entries, bool) + func (b *BlocksDB) Store(key string, entry Entry) + type Denylist struct + DoubleHashBlocksDB map[uint64]*BlocksDB + Entries Entries + Filename string + Header DenylistHeader + IPFSBlocksDB *BlocksDB + IPNSBlocksDB *BlocksDB + PathBlocksDB *BlocksDB + PathPrefixBlocks Entries + func NewDenylist(filepath string, follow bool) (*Denylist, error) + func NewDenylistReader(r io.ReadSeekCloser) (*Denylist, error) + func (dl *Denylist) Close() error + func (dl *Denylist) IsCidBlocked(c cid.Cid) StatusResponse + func (dl *Denylist) IsIPFSPathBlocked(cidStr, subpath string) StatusResponse + func (dl *Denylist) IsIPLDPathBlocked(cidStr, subpath string) StatusResponse + func (dl *Denylist) IsIPNSPathBlocked(name, subpath string) StatusResponse + func (dl *Denylist) IsPathBlocked(p path.Path) StatusResponse + func (dl *Denylist) IsSubpathBlocked(subpath string) StatusResponse + type DenylistHeader struct + Author string + Description string + Hints map[string]string + Name string + Version int + func (h *DenylistHeader) Decode(r io.Reader) error + func (h DenylistHeader) String() string + type Entries []Entry + func (entries Entries) CheckPathStatus(p string) (Status, Entry) + type Entry struct + AllowRule bool + Hints map[string]string + Line uint64 + Multihash multihash.Multihash + Path BlockedPath + RawValue string + func (e Entry) Clone() Entry + func (e Entry) String() string + type HTTPSubscriber struct + func NewHTTPSubscriber(remoteURL, localFile string, interval time.Duration) (*HTTPSubscriber, error) + func (s *HTTPSubscriber) Stop() + type Status int + const StatusAllowed + const StatusBlocked + const StatusErrored + const StatusNotFound + func (st Status) String() string + type StatusError struct + Response StatusResponse + func (err *StatusError) Error() string + type StatusResponse struct + Cid cid.Cid + Entry Entry + Error error + Filename string + Path path.Path + Status Status + func (r StatusResponse) String() string + func (r StatusResponse) ToError() *StatusError