Documentation ¶
Index ¶
- func DecodeNode(encoded []byte) (ipld.Node, error)
- func EncodeNode(node ipld.Node) ([]byte, error)
- func FetchBlock(ctx context.Context, dagCtx AnconSyncContext, c ipld.Link) error
- func NewPeer(ctx context.Context, addr string) host.Host
- func PrintProgress(ctx context.Context, pgChan <-chan gsync.ResponseProgress)
- func PushBlock(ctx context.Context, dagCtx *AnconSyncContext, c ipld.Link) error
- func ReadCAR() ([]cid.Cid, blocks.Block, datamodel.Node, error)
- func VerifyHasErrors(ctx context.Context, errChan <-chan error) error
- type AnconSyncContext
- func (dagctx *AnconSyncContext) AddDid(didType AvailableDid, domainName string, pubbytes []byte) (ipld.Link, error)
- func (dagctx *AnconSyncContext) BuildDidKey() (*did.Doc, error)
- func (dagctx *AnconSyncContext) BuildDidWeb(vanityName string, pubkey []byte) (*did.Doc, error)
- func (dagctx *AnconSyncContext) CreateDidKey(c *gin.Context)
- func (dagctx *AnconSyncContext) CreateDidWeb(c *gin.Context)
- func (dagctx *AnconSyncContext) DagCborRead(c *gin.Context)
- func (dagctx *AnconSyncContext) DagCborWrite(c *gin.Context)
- func (dagctx *AnconSyncContext) DagJsonRead(c *gin.Context)
- func (dagctx *AnconSyncContext) DagJsonWrite(c *gin.Context)
- func (dagctx *AnconSyncContext) FileRead(c *gin.Context)
- func (dagctx *AnconSyncContext) FileWrite(c *gin.Context)
- func (dagctx *AnconSyncContext) ParseDIDWeb(id string, useHTTP bool) (string, string, error)
- func (dagctx *AnconSyncContext) ReadDid(c *gin.Context)
- func (dagctx *AnconSyncContext) ReadDidWebUrl(c *gin.Context)
- type AvailableDid
- type ReceivedMessage
- type Receiver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeNode ¶ added in v0.4.1
func EncodeNode ¶ added in v0.4.1
func FetchBlock ¶ added in v0.4.1
func FetchBlock(ctx context.Context, dagCtx AnconSyncContext, c ipld.Link) error
func PrintProgress ¶ added in v0.4.1
func PrintProgress(ctx context.Context, pgChan <-chan gsync.ResponseProgress)
VerifyHasErrors verifies that at least one error was sent over a channel
func PushBlock ¶ added in v0.4.1
func PushBlock(ctx context.Context, dagCtx *AnconSyncContext, c ipld.Link) error
Types ¶
type AnconSyncContext ¶ added in v0.4.1
type AnconSyncContext struct { Store anconsync.Storage Exchange graphsync.GraphExchange IPFSPeer *peer.AddrInfo PrivateKey *ecdsa.PrivateKey }
func NewAnconSyncContext ¶ added in v0.4.1
func NewAnconSyncContext(s anconsync.Storage, exchange graphsync.GraphExchange, ipfspeer *peer.AddrInfo, privateKey *ecdsa.PrivateKey) *AnconSyncContext
func (*AnconSyncContext) AddDid ¶ added in v0.4.1
func (dagctx *AnconSyncContext) AddDid(didType AvailableDid, domainName string, pubbytes []byte) (ipld.Link, error)
func (*AnconSyncContext) BuildDidKey ¶ added in v0.4.1
func (dagctx *AnconSyncContext) BuildDidKey() (*did.Doc, error)
BuildDidKey ....
func (*AnconSyncContext) BuildDidWeb ¶ added in v0.4.1
BuildDidWeb ....
func (*AnconSyncContext) CreateDidKey ¶ added in v0.4.1
func (dagctx *AnconSyncContext) CreateDidKey(c *gin.Context)
func (*AnconSyncContext) CreateDidWeb ¶ added in v0.4.1
func (dagctx *AnconSyncContext) CreateDidWeb(c *gin.Context)
func (*AnconSyncContext) DagCborRead ¶ added in v0.4.1
func (dagctx *AnconSyncContext) DagCborRead(c *gin.Context)
@BasePath /v0 DagCborRead godoc @Summary Reads CBOR from a dag-cbor block @Schemes @Description Returns CBOR @Tags dag-cbor @Accept json @Produce json @Success 200 @Router /v0/dagcbor/{cid}/{path} [get]
func (*AnconSyncContext) DagCborWrite ¶ added in v0.4.1
func (dagctx *AnconSyncContext) DagCborWrite(c *gin.Context)
DagCborWrite godoc @Summary Stores CBOR as dag-json @Schemes @Description Writes a dag-cbor block which syncs with IPFS. Returns a CID. @Tags dag-cbor @Accept json @Produce json @Success 201 {string} cid @Router /v0/dagcbor [post]
func (*AnconSyncContext) DagJsonRead ¶ added in v0.4.1
func (dagctx *AnconSyncContext) DagJsonRead(c *gin.Context)
@BasePath /v0 DagJsonRead godoc @Summary Reads JSON from a dag-json block @Schemes @Description Returns JSON @Tags dag-json @Accept json @Produce json @Success 200 @Router /v0/dagjson/{cid}/{path} [get]
func (*AnconSyncContext) DagJsonWrite ¶ added in v0.4.1
func (dagctx *AnconSyncContext) DagJsonWrite(c *gin.Context)
@BasePath /v0 DagJsonWrite godoc @Summary Stores JSON as dag-json @Schemes @Description Writes a dag-json block which syncs with IPFS. Returns a CID. @Tags dag-json @Accept json @Produce json @Success 201 {string} cid @Router /v0/dagjson [post]
func (*AnconSyncContext) FileRead ¶ added in v0.4.1
func (dagctx *AnconSyncContext) FileRead(c *gin.Context)
@BasePath /v0 FileRead godoc @Summary Reads JSON from a dag-json block @Schemes @Description Returns JSON @Tags file @Accept json @Produce json @Success 200 @Router /v0/file/{cid}/{path} [get]
func (*AnconSyncContext) FileWrite ¶ added in v0.4.1
func (dagctx *AnconSyncContext) FileWrite(c *gin.Context)
@BasePath /v0 FileWrite godoc @Summary Stores files @Schemes @Description Writes a raw block which syncs with IPFS. Returns a CID. @Tags file @Accept json @Produce json @Success 201 {string} cid @Router /v0/file [post]
func (*AnconSyncContext) ParseDIDWeb ¶ added in v0.4.1
func (*AnconSyncContext) ReadDid ¶ added in v0.4.1
func (dagctx *AnconSyncContext) ReadDid(c *gin.Context)
func (*AnconSyncContext) ReadDidWebUrl ¶ added in v0.4.1
func (dagctx *AnconSyncContext) ReadDidWebUrl(c *gin.Context)
type AvailableDid ¶ added in v0.4.1
type AvailableDid string
const ( DidTypeWeb AvailableDid = "web" DidTypeKey AvailableDid = "key" )
type ReceivedMessage ¶ added in v0.4.1
type ReceivedMessage struct { Message gsmsg.GraphSyncMessage Sender peer.ID }
type Receiver ¶ added in v0.4.1
type Receiver struct {
MessageReceived chan ReceivedMessage
}
Receiver is an interface for receiving messages from the GraphSyncNetwork.