api

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(c *cli.Context) error

Types

type DealStats

type DealStats struct {
	Provider string
	State    model.DealState
	Day      string
	DealSize int64
}

type ItemInfo

type ItemInfo struct {
	//TODO Type     model.ItemType `json:"type"`
	Path     string `json:"path"`
	SourceID uint32 `json:"sourceId"`
}

type Server

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

func (Server) GetCars

func (d Server) GetCars(c echo.Context) error

func (Server) GetDatasets

func (d Server) GetDatasets(c echo.Context) error

func (Server) GetDealStats

func (d Server) GetDealStats(c echo.Context) error

func (Server) GetDealsForCar

func (d Server) GetDealsForCar(c echo.Context) error

func (Server) GetDealsForItem

func (d Server) GetDealsForItem(c echo.Context) error

func (Server) GetDirectoryEntries

func (d Server) GetDirectoryEntries(c echo.Context) error

func (Server) GetItems

func (d Server) GetItems(c echo.Context) error

func (Server) GetMetadataHandler

func (s Server) GetMetadataHandler(c echo.Context) error

GetMetadataHandler godoc @Summary Get metadata for a piece @Description Get metadata for a piece @Tags Piece @Accept json @Produce json @Param piece path string true "Piece CID" @Success 200 {object} store.PieceReader @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /piece/metadata/{piece} [get]

func (Server) GetOverallDealStats

func (d Server) GetOverallDealStats(c echo.Context) error

func (Server) GetSources

func (d Server) GetSources(c echo.Context) error

func (Server) HandlePostSource

func (d Server) HandlePostSource(c echo.Context) error

func (Server) PushItem

func (s Server) PushItem(c echo.Context) error

PushItem godoc @Summary Push an item to the staging area @Description Push an item to the staging area @Tags Data Source @Accept json @Produce json @Param item body ItemInfo true "Item" @Success 200 {string} string "OK" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /dataset/push [post]

func (Server) Run

func (d Server) Run(c *cli.Context) error

func (Server) UploadFile

func (s Server) UploadFile(c echo.Context) error

UploadFile godoc @Summary Upload a file to a dataset @Description Upload a file to a dataset @Tags Data Source @Accept mpfd @Produce text/plain @Param dataset query string true "Dataset name" @Param file formData file true "File to upload" @Success 200 {string} string "File uploaded" @Failure 400 {string} string "Error: dataset name is required." @Failure 400 {string} string "Error: file is required." @Failure 400 {string} string "Error: dataset not found." @Failure 500 {string} string "Error: internal server error." @Router /dataset/upload [post]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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