gateway

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileNotFound        = api.NewBusinessError(101, "File not found")
	ErrFilePruned          = api.NewBusinessError(102, "File already pruned")
	ErrFileNotFinalized    = api.NewBusinessError(103, "File not finalized yet")
	ErrFilePathNotFound    = api.NewBusinessError(104, "File path not found")
	ErrFileSizeTooLarge    = api.NewBusinessError(105, "File size too large")
	ErrFileTypeUnsupported = api.NewBusinessError(106, "File type unsupported")
)

Functions

func MustServeWithRPC

func MustServeWithRPC(nodeManager *indexer.NodeManager, locationCache *indexer.FileLocationCache, config Config)

Types

type Cid added in v0.6.2

type Cid struct {
	Root  string  `form:"root" json:"root"`
	TxSeq *uint64 `form:"txSeq" json:"txSeq"`
}

func NewCid added in v0.6.2

func NewCid(cidStr string) Cid

NewCid parsing the CID from the input string.

type Config

type Config struct {
	Endpoint            string       // http endpoint
	RPCHandler          http.Handler // enable to provide both RPC and REST API service
	MaxDownloadFileSize uint64       // max download file size
}

type RestController added in v0.6.2

type RestController struct {
	// contains filtered or unexported fields
}

func NewRestController added in v0.6.2

func NewRestController(nodeManager *indexer.NodeManager, locationCache *indexer.FileLocationCache, maxDownloadFileSize uint64) *RestController

type UploadSegmentRequest added in v0.6.2

type UploadSegmentRequest struct {
	Root            common.Hash  `json:"root"`            // file merkle root
	TxSeq           *uint64      `json:"txSeq"`           // Transaction sequence
	Data            []byte       `json:"data"`            // segment data
	Index           uint64       `json:"index"`           // segment index
	Proof           merkle.Proof `json:"proof"`           // segment merkle proof
	ExpectedReplica uint         `json:"expectedReplica"` // expected replica count, default 1
}

Jump to

Keyboard shortcuts

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