github.com/ethersphere/bee/v2@v2.2.0/pkg/resolver/client/ens/export_test.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 ens 6 7 import ( 8 "github.com/ethereum/go-ethereum/common" 9 "github.com/ethereum/go-ethereum/ethclient" 10 goens "github.com/wealdtech/go-ens/v3" 11 ) 12 13 const SwarmContentHashPrefix = swarmContentHashPrefix 14 15 // WithConnectFunc will set the Dial function implementation. 16 func WithConnectFunc(fn func(endpoint string, contractAddr string) (*ethclient.Client, *goens.Registry, error)) Option { 17 return func(c *Client) { 18 c.connectFn = fn 19 } 20 } 21 22 // WithResolveFunc will set the Resolve function implementation. 23 func WithResolveFunc(fn func(registry *goens.Registry, addr common.Address, input string) (string, error)) Option { 24 return func(c *Client) { 25 c.resolveFn = fn 26 } 27 }