Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { APIURL string // URL of an IPFS API endpoint (for Ls and Stat calls). GatewayURL string // URL of an IPFS Gateway (to request content). PartialSize datasize.ByteSize // Filesize of items which are being considered partials (chunks). }
Config specifies the configuration for the IPFS protocol.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration for a Sniffer.
type IPFS ¶
type IPFS struct { *instr.Instrumentation // contains filtered or unexported fields }
IPFS implements the Protocol interface for the Interplanery Filesystem. It is concurrency-safe.
func (*IPFS) GatewayURL ¶
func (i *IPFS) GatewayURL(r *t.AnnotatedResource) string
GatewayURL returns the URL to request a resource from the gateway. If a reference is available, it is used to generate the filename to facilitate content type detection (e.g. /ipfs/<parent_hash>/my_file.jpg instead of /ipfs/<file_hash>/). Ref: http://docs.ipfs.io.ipns.localhost:8080/concepts/ipfs-gateway/#gateway-types
func (*IPFS) Ls ¶
func (i *IPFS) Ls(ctx context.Context, r *t.AnnotatedResource, out chan<- *t.AnnotatedResource) error
Ls returns a channel with AnnotatedResource's with Type and Size populated.
func (*IPFS) Stat ¶
Stat returns a AnnotatedResource with Type and Size populated. Ref: http://docs.ipfs.io.ipns.localhost:8080/reference/http/api/#api-v0-files-stat