handler

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 41 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)

func GraphqlHandler added in v0.4.6

func GraphqlHandler(s sdk.Storage) gin.HandlerFunc

Defining the Graphql handler

func JsonRPCHandler added in v0.4.6

func JsonRPCHandler(anconCtx sdk.AnconSyncContext, gqlAddress string) gin.HandlerFunc

Defining the JSON RPC handler

func PlaygroundHandler added in v0.4.6

func PlaygroundHandler(s sdk.Storage) gin.HandlerFunc

Defining the Playground handler

func RPCHandler added in v0.4.6

func RPCHandler(anconCtx sdk.AnconSyncContext, gqlAddress string) gin.HandlerFunc

Defining the dageth RPC handler

Types

type AvailableDid

type AvailableDid string
const (
	DidTypeWeb AvailableDid = "web"
	DidTypeKey AvailableDid = "key"
)

type DagCborHandler added in v0.4.6

type DagCborHandler struct {
	*sdk.AnconSyncContext
}

func (*DagCborHandler) DagCborRead added in v0.4.6

func (dagctx *DagCborHandler) 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 (*DagCborHandler) DagCborWrite added in v0.4.6

func (dagctx *DagCborHandler) 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]

type DagJsonHandler added in v0.4.6

type DagJsonHandler struct {
	*sdk.AnconSyncContext
}

func (*DagJsonHandler) DagJsonRead added in v0.4.6

func (dagctx *DagJsonHandler) 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 (*DagJsonHandler) DagJsonWrite added in v0.4.6

func (dagctx *DagJsonHandler) 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]

type Did added in v0.4.6

type Did struct {
	*sdk.AnconSyncContext
}

func (*Did) AddDid added in v0.4.6

func (dagctx *Did) AddDid(didType AvailableDid, domainName string, pubbytes []byte) (ipld.Link, error)

func (*Did) BuildDidKey added in v0.4.6

func (dagctx *Did) BuildDidKey() (*did.Doc, error)

BuildDidKey ....

func (*Did) BuildDidWeb added in v0.4.6

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

BuildDidWeb ....

func (*Did) CreateDidKey added in v0.4.6

func (dagctx *Did) CreateDidKey(c *gin.Context)

func (*Did) CreateDidWeb added in v0.4.6

func (dagctx *Did) CreateDidWeb(c *gin.Context)

func (*Did) ParseDIDWeb added in v0.4.6

func (dagctx *Did) ParseDIDWeb(id string, useHTTP bool) (string, string, error)

func (*Did) ReadDid added in v0.4.6

func (dagctx *Did) ReadDid(c *gin.Context)

func (*Did) ReadDidWebUrl added in v0.4.6

func (dagctx *Did) ReadDidWebUrl(c *gin.Context)

type FileHandler added in v0.4.6

type FileHandler struct {
	*sdk.AnconSyncContext
}

func (*FileHandler) FileRead added in v0.4.6

func (dagctx *FileHandler) 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 (*FileHandler) FileWrite added in v0.4.6

func (dagctx *FileHandler) 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]

type ProofHandler added in v0.4.6

type ProofHandler struct {
	*sdk.AnconSyncContext
	// contains filtered or unexported fields
}

func NewProofHandler added in v0.4.6

func NewProofHandler(ctx *sdk.AnconSyncContext, dbPath string) *ProofHandler

func (*ProofHandler) Create added in v0.4.6

func (dagctx *ProofHandler) Create(c *gin.Context)

@BasePath /v0 Create godoc @Summary Create @Schemes @Description Writes an ics23 proof @Tags proofs @Accept json @Produce json @Success 201 {string} cid @Router /v0/dagjson [post]

func (*ProofHandler) Read added in v0.4.6

func (dagctx *ProofHandler) Read(c *gin.Context)

@BasePath /v0 Read godoc @Summary Reads an existing proof @Schemes @Description Returns JSON @Tags proofs @Accept json @Produce json @Success 200 @Router /v0/dagjson/{cid}/{path} [get]

func (*ProofHandler) ReadCurrentRootHash added in v0.4.6

func (dagctx *ProofHandler) ReadCurrentRootHash(c *gin.Context)

@BasePath /v0 Verify godoc @Summary Verifies an ics23 proofs @Schemes @Description Verifies an ics23 proof @Tags proofs @Accept json @Produce json @Success 201 {string} cid @Router /v0/proofs/verify [post]

type WasmVMHandler added in v0.4.6

type WasmVMHandler struct {
	*sdk.AnconSyncContext
	// contains filtered or unexported fields
}

func NewWasmVMHandler added in v0.4.6

func NewWasmVMHandler(ctx *sdk.AnconSyncContext, proofs *proofsignature.IavlProofAPI) *WasmVMHandler

func (*WasmVMHandler) Execute added in v0.4.6

func (dagctx *WasmVMHandler) Execute(c *gin.Context)

@BasePath /v0 Execute godoc @Summary Executes a WASM smart contract @Schemes @Description ... @Tags proofs @Accept json @Produce json @Success 201 {string} cid @Router /v0/contracts/execute [post]

Jump to

Keyboard shortcuts

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