handler

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeNode

func DecodeNode(encoded []byte) (ipld.Node, error)

func EncodeNode

func EncodeNode(node ipld.Node) ([]byte, error)

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

func (dagctx *AnconSyncContext) BuildDidWeb(vanityName string, pubkey []byte) (*did.Doc, error)

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 (dagctx *AnconSyncContext) ParseDIDWeb(id string, useHTTP bool) (string, string, error)

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"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL