api

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0, MIT Imports: 34 Imported by: 0

Documentation

Overview

Package api It takes a path, parses it, and returns the protocol, the CID, and the path segments

Index

Constants

This section is empty.

Variables

View Source
var (
	OsSignal chan os.Signal
)

Functions

func ConfigureGatewayRouter

func ConfigureGatewayRouter(e *echo.Group, node *core.LightNode)

func ConfigureHealthCheckRouter

func ConfigureHealthCheckRouter(healthCheckApiGroup *echo.Group, node *core.LightNode)

ConfigureHealthCheckRouter > ConfigureHealthCheckRouter is a function that takes a pointer to an echo.Group and a pointer to a DeltaNode and returns nothing

func ConfigureNodeInfoRouter

func ConfigureNodeInfoRouter(e *echo.Group, node *core.LightNode)

ConfigureNodeInfoRouter It configures the router to handle requests for node information

func ConfigurePinningRouter

func ConfigurePinningRouter(e *echo.Group, node *core.LightNode)

func ConfigureRetrieveRouter

func ConfigureRetrieveRouter(e *echo.Group, node *core.LightNode)

func ConfigureStatsRouter

func ConfigureStatsRouter(e *echo.Group, node *core.LightNode)

func ConfigureStatusCheckRouter

func ConfigureStatusCheckRouter(e *echo.Group, node *core.LightNode)

func ErrorHandler

func ErrorHandler(err error, c echo.Context)

func GatewayContentResolverCheckHandler

func GatewayContentResolverCheckHandler(c echo.Context) error

func GatewayResolverCheckHandlerDirectPath

func GatewayResolverCheckHandlerDirectPath(c echo.Context) error

`GatewayResolverCheckHandlerDirectPath` is a function that takes a `echo.Context` and returns an `error`

func InitializeEchoRouterConfig

func InitializeEchoRouterConfig(ln *core.LightNode)

RouterConfig configures the API node

func LoopForever

func LoopForever()

LoopForever on signal processing

func RetrieveSplitHandler

func RetrieveSplitHandler(c echo.Context, node *core.LightNode) error

RetrieveSplitHandler is the handler for the /retrieve/split endpoint

func ServeDir

func ServeDir(ctx context.Context, n mdagipld.Node, w http.ResponseWriter, req *http.Request) error

func SniffMimeType

func SniffMimeType(w http.ResponseWriter, dr uio.DagReader) error

Types

type AuthResponse

type AuthResponse struct {
	Result struct {
		Validated bool   `json:"validated"`
		Details   string `json:"details"`
	} `json:"result"`
}

func GetAuthResponse

func GetAuthResponse(resp *http.Response) (AuthResponse, error)

type CidRequest

type CidRequest struct {
	Cids []string `json:"cids"`
}

type Context

type Context struct {
	CustomLinks []CustomLinks
}
type CustomLinks struct {
	Href     string
	HrefCid  string
	LinkName string
	Size     string
}

type DealE2EUploadRequest

type DealE2EUploadRequest struct {
	Cid                string `json:"cid,omitempty"`
	Miner              string `json:"miner,omitempty"`
	Duration           int64  `json:"duration,omitempty"`
	DurationInDays     int64  `json:"duration_in_days,omitempty"`
	ConnectionMode     string `json:"connection_mode,omitempty"`
	Size               int64  `json:"size,omitempty"`
	StartEpoch         int64  `json:"start_epoch,omitempty"`
	StartEpochInDays   int64  `json:"start_epoch_in_days,omitempty"`
	Replication        int    `json:"replication,omitempty"`
	RemoveUnsealedCopy bool   `json:"remove_unsealed_copy"`
	SkipIPNIAnnounce   bool   `json:"skip_ipni_announce"`
	AutoRetry          bool   `json:"auto_retry"`
	Label              string `json:"label,omitempty"`
	DealVerifyState    string `json:"deal_verify_state,omitempty"`
}

type DealE2EUploadResponse

type DealE2EUploadResponse struct {
	Status                       string      `json:"status"`
	Message                      string      `json:"message"`
	ContentId                    int64       `json:"content_id,omitempty"`
	DealRequest                  interface{} `json:"deal_request_meta,omitempty"`
	DealProposalParameterRequest interface{} `json:"deal_proposal_parameter_request_meta,omitempty"`
	ReplicatedContents           interface{} `json:"replicated_contents,omitempty"`
}

DealE2EUploadResponse DealResponse Creating a new struct called DealResponse and then returning it.

type GatewayHandler

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

func (*GatewayHandler) GatewayDirResolverCheckHandler

func (gw *GatewayHandler) GatewayDirResolverCheckHandler(c echo.Context) error

func (*GatewayHandler) ServeHTTP

func (gw *GatewayHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HttpError

type HttpError struct {
	Code    int    `json:"code,omitempty"`
	Reason  string `json:"reason"`
	Details string `json:"details"`
}

func (HttpError) Error

func (he HttpError) Error() string

type HttpErrorResponse

type HttpErrorResponse struct {
	Error HttpError `json:"error"`
}

type Stats

type Stats struct {
	TotalContentCount int `json:"total_content_count"`
	TotalSize         int `json:"total_size"`
}

type StatusCheckResponse

type StatusCheckResponse struct {
	Content struct {
		ID             int64  `json:"id"`
		Name           string `json:"name"`
		DeltaContentId int64  `json:"delta_content_id,omitempty"`
		Cid            string `json:"cid,omitempty"`
		Status         string `json:"status"`
		Message        string `json:"message,omitempty"`
	} `json:"content"`
}

type UploadResponse

type UploadResponse struct {
	Status       string      `json:"status"`
	Message      string      `json:"message"`
	ID           int64       `json:"id,omitempty"`
	Cid          string      `json:"cid,omitempty"`
	DeltaContent interface{} `json:"delta_content,omitempty"`
	ContentUrl   string      `json:"content_url,omitempty"`
}

type UploadSplitResponse

type UploadSplitResponse struct {
	Status        string              `json:"status"`
	Message       string              `json:"message"`
	RootCid       string              `json:"rootCid,omitempty"`
	RootContentId int64               `json:"rootContentId,omitempty"`
	Splits        []core.UploadSplits `json:"splits,omitempty"`
}

Jump to

Keyboard shortcuts

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