Documentation ¶
Index ¶
- Constants
- Variables
- type CleanupTarget
- type DummyTarget
- func (dt *DummyTarget) Backoff(ctx context.Context) backoff.BackOff
- func (dt *DummyTarget) CleanUp(ctx context.Context, c cid.Cid) error
- func (dt *DummyTarget) Name() string
- func (dt *DummyTarget) Operation(ctx context.Context, c cid.Cid) error
- func (dt *DummyTarget) Rate() time.Duration
- func (dt *DummyTarget) Timeout() time.Duration
- func (dt *DummyTarget) Type() string
- type Gateway
- func (g *Gateway) Backoff(ctx context.Context) backoff.BackOff
- func (g *Gateway) CleanUp(ctx context.Context, c cid.Cid) error
- func (g *Gateway) Name() string
- func (g *Gateway) Operation(ctx context.Context, c cid.Cid) error
- func (g *Gateway) Rate() time.Duration
- func (g *Gateway) Timeout() time.Duration
- func (g *Gateway) Type() string
- type Infura
- func (i *Infura) Backoff(ctx context.Context) backoff.BackOff
- func (i *Infura) CleanUp(ctx context.Context, c cid.Cid) error
- func (i *Infura) Name() string
- func (i *Infura) Operation(ctx context.Context, c cid.Cid) error
- func (i *Infura) Rate() time.Duration
- func (i *Infura) Timeout() time.Duration
- func (i *Infura) Type() string
- type Payload
- type PinProbe
- type PinTarget
- type Pinata
- func (p *Pinata) Backoff(ctx context.Context) backoff.BackOff
- func (p *Pinata) CleanUp(ctx context.Context, c cid.Cid) error
- func (p *Pinata) Name() string
- func (p *Pinata) Operation(ctx context.Context, c cid.Cid) error
- func (p *Pinata) Rate() time.Duration
- func (p *Pinata) Timeout() time.Duration
- func (p *Pinata) Type() string
- type PinataMetadata
- type PinataOptions
- type PinataRequest
- type PinningServiceTargetConstructor
- type Probe
- type Scheduler
- type Target
- type Throttle
- type Tracer
- type UploadProbe
- type UploadServiceTargetConstructor
- type UploadTarget
- type Web3
- func (t *Web3) Backoff(ctx context.Context) backoff.BackOff
- func (t *Web3) CleanUp(ctx context.Context, c cid.Cid) error
- func (t *Web3) Name() string
- func (t *Web3) Rate() time.Duration
- func (t *Web3) Timeout() time.Duration
- func (t *Web3) Type() string
- func (t *Web3) UploadContent(ctx context.Context, block *blocks.BasicBlock) error
- type Web3UploadResponse
Constants ¶
const GatewayURLReplaceStr = "{cid}"
const InfuraTargetName = "infura"
const PinataTargetName = "pinata"
const Web3TargetName = "web3"
Variables ¶
var PinningServiceTargetConstructors = map[string]PinningServiceTargetConstructor{ InfuraTargetName: NewInfura, PinataTargetName: NewPinata, }
var UploadServiceTargetConstructors = map[string]UploadServiceTargetConstructor{ Web3TargetName: NewWeb3, }
Functions ¶
This section is empty.
Types ¶
type CleanupTarget ¶
type DummyTarget ¶
type DummyTarget struct{}
DummyTarget is here to detect peers that sniff DHT traffic. No one should ever request data provided by this target.
func NewDummyTarget ¶
func NewDummyTarget() *DummyTarget
func (*DummyTarget) Backoff ¶
func (dt *DummyTarget) Backoff(ctx context.Context) backoff.BackOff
func (*DummyTarget) Name ¶
func (dt *DummyTarget) Name() string
func (*DummyTarget) Operation ¶
func (dt *DummyTarget) Operation(ctx context.Context, c cid.Cid) error
func (*DummyTarget) Rate ¶
func (dt *DummyTarget) Rate() time.Duration
func (*DummyTarget) Timeout ¶
func (dt *DummyTarget) Timeout() time.Duration
func (*DummyTarget) Type ¶
func (dt *DummyTarget) Type() string
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
func NewGatewayTarget ¶
type Payload ¶
Payload is the underlying data that gets announced to the network
func NewPayload ¶
NewPayload generates 100 bytes of random data and initializes a Payload data structure. It's also signing the data for no reason.
type PinataMetadata ¶
type PinataMetadata struct {
Name string `json:"name"`
}
type PinataOptions ¶
type PinataOptions struct {
HostNodes []string `json:"hostNodes"`
}
type PinataRequest ¶
type PinataRequest struct { HashToPin string `json:"hashToPin"` PinataMetadata *PinataMetadata `json:"pinataMetadata,omitempty"` PinataOptions *PinataOptions `json:"pinataOptions,omitempty"` }
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
The Scheduler is responsible for the initialization of Targets and Probes. Targets are entities like gateways or pinning services. Probes can be configured with a specific Target and carry out the publication of content and later the request through the Target. After all targets are initialized from the configuration, they get assigned a PinProbe. These probes are then instructed to start doing their thing - which means, announcing CIDs to the DHT and then requesting it through the associated target.
type Throttle ¶
type Throttle struct { C <-chan time.Time // The channel on which the leases are delivered. // contains filtered or unexported fields }
func NewThrottle ¶
NewThrottle returns a new Throttle containing a channel that will send the time x number of times within a period specified by the duration argument. It drops leases to make up for slow receivers. The duration must be greater than zero; if not, NewThrottle will panic. Stop the throttle to release associated resources and close its channel.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func (*Tracer) MessageReceived ¶
func (t *Tracer) MessageReceived(id peer.ID, msg message.BitSwapMessage)
func (*Tracer) MessageSent ¶
func (t *Tracer) MessageSent(id peer.ID, msg message.BitSwapMessage)
func (*Tracer) Unregister ¶
func (t *Tracer) Unregister(contentID cid.Cid)
type UploadProbe ¶
type UploadProbe struct {
// contains filtered or unexported fields
}
type UploadServiceTargetConstructor ¶
type UploadServiceTargetConstructor = func(host host.Host, auth string) (UploadTarget, error)
type UploadTarget ¶
type Web3 ¶
type Web3 struct {
// contains filtered or unexported fields
}