func (s Sources) String() string {
	var b strings.Builder
	_, _ = b.WriteString("{")
	if s.CARURL != nil {
		_, _ = fmt.Fprintf(&b, "url: %s,", s.CARURL.URL.String())
	}
	if s.CARIPFS != nil {
		_, _ = fmt.Fprintf(&b, "cid: %s,", s.CARIPFS.Cid.String())
	}
	_, _ = b.WriteString("}")
	return b.String()
}
String returns the string representation of the sources.
package auction
import (
	"errors"
	"fmt"
	"net/url"
	"strings"
	"github.com/ipfs/go-cid"
	"github.com/multiformats/go-multiaddr"
)
const (
	epochsPerDay uint64 = 60 * 24 * 2  
	MinDealDuration = epochsPerDay * 365 / 2  
	MaxDealDuration = epochsPerDay * 510  
	HTTPCarHeaderOnly = "X-Bidbot-Car-Header-Only"
	ErrStringWouldExceedRunningBytesLimit = "would exceed running bytes limit"
)
type BidID string
type CARURL struct {
	URL url.URL
}
type CARIPFS struct {
	Cid        cid.Cid
	Multiaddrs []multiaddr.Multiaddr
}
type Sources struct {
	CARURL  *CARURL
	CARIPFS *CARIPFS
}
func (s Sources) Validate() error {
	if s.CARURL == nil && s.CARIPFS == nil {
		return errors.New("should contain at least one source")
	}
	if s.CARURL != nil {
		switch s.CARURL.URL.Scheme {
		case "http", "https":
		default:
			return fmt.Errorf("unsupported scheme %s", s.CARURL.URL.Scheme)
		}
	}
	if s.CARIPFS != nil {
		if !s.CARIPFS.Cid.Defined() {
			return errors.New("cid undefined")
		}
		if len(s.CARIPFS.Multiaddrs) == 0 {
			return errors.New("no multiaddr")
		}
	}
	return nil
}