Documentation
¶
Index ¶
- func DecodeNode(encoded []byte) (ipld.Node, error)
- func EncodeNode(node ipld.Node) ([]byte, 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnconSyncContext ¶
type AnconSyncContext struct {
Store anconsync.Storage
Exchange graphsync.GraphExchange
IPFSPeer *peer.AddrInfo
PrivateKey *ecdsa.PrivateKey
}
func NewAnconSyncContext ¶
func NewAnconSyncContext(s anconsync.Storage, exchange graphsync.GraphExchange, ipfspeer *peer.AddrInfo, privateKey *ecdsa.PrivateKey) *AnconSyncContext
func (*AnconSyncContext) AddDid ¶
func (dagctx *AnconSyncContext) AddDid(didType AvailableDid, domainName string, pubbytes []byte) (ipld.Link, error)
func (*AnconSyncContext) BuildDidKey ¶
func (dagctx *AnconSyncContext) BuildDidKey() (*did.Doc, error)
BuildDidKey ....
func (*AnconSyncContext) BuildDidWeb ¶
BuildDidWeb ....
func (*AnconSyncContext) CreateDidKey ¶
func (dagctx *AnconSyncContext) CreateDidKey(c *gin.Context)
func (*AnconSyncContext) CreateDidWeb ¶
func (dagctx *AnconSyncContext) CreateDidWeb(c *gin.Context)
func (*AnconSyncContext) DagCborRead ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (*AnconSyncContext) ReadDid ¶
func (dagctx *AnconSyncContext) ReadDid(c *gin.Context)
func (*AnconSyncContext) ReadDidWebUrl ¶
func (dagctx *AnconSyncContext) ReadDidWebUrl(c *gin.Context)
type AvailableDid ¶
type AvailableDid string
const ( DidTypeWeb AvailableDid = "web" DidTypeKey AvailableDid = "key" )