github.com/ethersphere/bee/v2@v2.2.0/pkg/resolver/resolver.go (about)

     1  // Copyright 2020 The Swarm Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package resolver
     6  
     7  import (
     8  	"errors"
     9  	"io"
    10  
    11  	"github.com/ethersphere/bee/v2/pkg/swarm"
    12  )
    13  
    14  // Address is the swarm bzz address.
    15  type Address = swarm.Address
    16  
    17  var (
    18  	// ErrParse denotes failure to parse given value
    19  	ErrParse = errors.New("could not parse")
    20  	// ErrNotFound denotes that given name was not found
    21  	ErrNotFound = errors.New("not found")
    22  	// ErrServiceNotAvailable denotes that remote ENS service is not available
    23  	ErrServiceNotAvailable = errors.New("not available")
    24  	// ErrInvalidContentHash denotes that the value of the response contenthash record is not valid.
    25  	ErrInvalidContentHash = errors.New("invalid swarm content hash")
    26  )
    27  
    28  // Interface can resolve an URL into an associated Ethereum address.
    29  type Interface interface {
    30  	Resolve(url string) (Address, error)
    31  	io.Closer
    32  }