Documentation ¶
Index ¶
- func DecodeMultiaddr(addr multiaddr.Multiaddr) (IPOrHost, IsHostName, PortNumber, error)
- func EpochToTime(epoch int32) time.Time
- func GetRequiredEnv(key string) string
- func MustSetEnv(key, value string)
- type Content
- type DealID
- type DealState
- type IPInfo
- type IPOrHost
- type IsHostName
- type LocationResolver
- func (l LocationResolver) ResolveIP(ctx context.Context, ip net.IP) (IPInfo, error)
- func (l LocationResolver) ResolveIPStr(ctx context.Context, ip string) (IPInfo, error)
- func (l LocationResolver) ResolveMultiaddr(ctx context.Context, addr multiaddr.Multiaddr) (IPInfo, error)
- func (l LocationResolver) ResolveMultiaddrs(ctx context.Context, addrs []multiaddr.Multiaddr) (IPInfo, error)
- func (l LocationResolver) ResolveMultiaddrsBytes(ctx context.Context, bytesAddrs []abi.Multiaddrs) (IPInfo, error)
- type ModuleName
- type PortNumber
- type ProcessManager
- type Provider
- type ProviderResolver
- type RetrievalResult
- type Retriever
- type Task
- type TaskResult
- type TaskWorker
- type TaskWorkerProcess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeMultiaddr ¶
func DecodeMultiaddr(addr multiaddr.Multiaddr) (IPOrHost, IsHostName, PortNumber, error)
func EpochToTime ¶
func GetRequiredEnv ¶
func MustSetEnv ¶
func MustSetEnv(key, value string)
Types ¶
type IPInfo ¶
type IPInfo struct { IP string `json:"ip"` City string `json:"city"` Region string `json:"region"` Country string `json:"country"` Continent string `json:"continent"` Loc string `json:"loc"` Org string `json:"org"` Postal string `json:"postal"` Timezone string `json:"timezone"` Bogon bool `json:"bogon"` }
type IsHostName ¶
type IsHostName = bool
type LocationResolver ¶
type LocationResolver struct {
// contains filtered or unexported fields
}
func NewLocationResolver ¶
func NewLocationResolver(ipInfoToken string, ttl time.Duration) LocationResolver
func (LocationResolver) ResolveIPStr ¶
func (LocationResolver) ResolveMultiaddr ¶
func (l LocationResolver) ResolveMultiaddr(ctx context.Context, addr multiaddr.Multiaddr) (IPInfo, error)
func (LocationResolver) ResolveMultiaddrs ¶
func (l LocationResolver) ResolveMultiaddrs(ctx context.Context, addrs []multiaddr.Multiaddr) (IPInfo, error)
func (LocationResolver) ResolveMultiaddrsBytes ¶
func (l LocationResolver) ResolveMultiaddrsBytes(ctx context.Context, bytesAddrs []abi.Multiaddrs) (IPInfo, error)
type ModuleName ¶
type ModuleName string
const ( Stub ModuleName = "stub" GraphSync ModuleName = "graphsync" HTTP ModuleName = "http" Bitswap ModuleName = "bitswap" )
type PortNumber ¶
type PortNumber = int
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
func NewProcessManager ¶
func NewProcessManager() (*ProcessManager, error)
func (ProcessManager) Run ¶
func (p ProcessManager) Run(ctx context.Context)
type ProviderResolver ¶
type ProviderResolver struct {
// contains filtered or unexported fields
}
func NewProviderResolver ¶
func (*ProviderResolver) Close ¶
func (p *ProviderResolver) Close()
func (*ProviderResolver) ResolveProvider ¶
type RetrievalResult ¶
type Task ¶
type Task struct { Requester string `bson:"requester"` Module ModuleName `bson:"module"` Metadata map[string]interface{} `bson:"metadata,omitempty"` Provider Provider `bson:"provider"` Content Content `bson:"content"` Options map[string]interface{} `bson:"options,omitempty"` CreatedAt time.Time `bson:"created_at"` }
type TaskResult ¶
type TaskResult struct { Task Retriever Retriever `bson:"retriever"` Result RetrievalResult `bson:"result"` CreatedAt time.Time `bson:"created_at"` }
type TaskWorker ¶
type TaskWorker interface {
DoWork(task Task) (RetrievalResult, error)
}
type TaskWorkerProcess ¶
type TaskWorkerProcess struct {
// contains filtered or unexported fields
}
func NewTaskWorkerProcess ¶
func NewTaskWorkerProcess( ctx context.Context, module ModuleName, worker TaskWorker) (*TaskWorkerProcess, error)
func (TaskWorkerProcess) Close ¶
func (t TaskWorkerProcess) Close()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.