Documentation ¶
Index ¶
- Constants
- Variables
- func AppVersionMiddleware(appVersion string) echo.MiddlewareFunc
- func CalculateCarSize(data cid.Cid, objects []Object) (uint64, error)
- func CidIsUnwalkable(c cid.Cid) bool
- func DirsFromPath(collectionPath string, filename string) ([]string, error)
- func EnsurePathIsLinked(dirs []string, rootNode *merkledag.ProtoNode, ds format.DAGService) (*merkledag.ProtoNode, error)
- func ErrorHandler(err error, ctx echo.Context)
- func ExtractAuth(c echo.Context) (string, error)
- func FilterUnwalkableLinks(links []*ipld.Link) []*ipld.Link
- func ImportFile(dserv ipld.DAGService, fi io.Reader) (ipld.Node, error)
- func ParseDealLabel(s string) (cid.Cid, error)
- func SetupDatabase(dbval string) (*gorm.DB, error)
- func TransferTerminated(st *filclient.ChannelState) bool
- func TryExtractFSNode(nd ipld.Node) (*unixfs.FSNode, error)
- func ValidatePeerInfo(peerID string, addresses []string) (*peer.AddrInfo, error)
- type AutoretrieveInitResponse
- type AutoretrieveListResponse
- type ChanTrack
- type ContentAddIpfsBody
- type ContentAddResponse
- type ContentCreateBody
- type ContentCreateResponse
- type ContentInCollection
- type ContentType
- type DbAddr
- type DbCID
- type GenericResponse
- type HeartbeatAutoretrieveResponse
- type HttpError
- type HttpErrorResponse
- type InitShuttleResponse
- type Object
- type PeeringPeerAddMessage
- type PeeringPeerRemoveMessage
- type RetrievalFailureRecord
- type RetrievalProgress
- type Shuttle
- type ShuttleCreateContentBody
- type ShuttleListResponse
- type ShuttleStorageStats
- type UserSettings
- type ViewerResponse
Constants ¶
View Source
const ( ERR_INVALID_TOKEN = "ERR_INVALID_TOKEN" ERR_TOKEN_EXPIRED = "ERR_TOKEN_EXPIRED" ERR_AUTH_MISSING = "ERR_AUTH_MISSING" ERR_WRONG_AUTH_FORMAT = "ERR_WRONG_AUTH_FORMAT" ERR_INVALID_AUTH = "ERR_INVALID_AUTH" ERR_AUTH_MISSING_BEARER = "ERR_AUTH_MISSING_BEARER" ERR_NOT_AUTHORIZED = "ERR_NOT_AUTHORIZED" ERR_MINER_NOT_OWNED = "ERR_MINER_NOT_OWNED" ERR_INVALID_INVITE = "ERR_INVALID_INVITE" ERR_USERNAME_TAKEN = "ERR_USERNAME_TAKEN" ERR_USER_CREATION_FAILED = "ERR_USER_CREATION_FAILED" ERR_USER_NOT_FOUND = "ERR_USER_NOT_FOUND" ERR_INVALID_PASSWORD = "ERR_INVALID_PASSWORD" ERR_INVITE_ALREADY_USED = "ERR_INVITE_ALREADY_USED" ERR_CONTENT_ADDING_DISABLED = "ERR_CONTENT_ADDING_DISABLED" ERR_INVALID_INPUT = "ERR_INVALID_INPUT" ERR_CONTENT_SIZE_OVER_LIMIT = "ERR_CONTENT_SIZE_OVER_LIMIT" ERR_PEERING_PEERS_ADD_ERROR = "ERR_PEERING_PEERS_ADD_ERROR" ERR_PEERING_PEERS_REMOVE_ERROR = "ERR_PEERING_PEERS_REMOVE_ERROR" ERR_PEERING_PEERS_START_ERROR = "ERR_PEERING_PEERS_START_ERROR" ERR_PEERING_PEERS_STOP_ERROR = "ERR_PEERING_PEERS_STOP_ERROR" ERR_CONTENT_NOT_FOUND = "ERR_CONTENT_NOT_FOUND" ERR_INVALID_PINNING_STATUS = "ERR_INVALID_PINNING_STATUS" )
View Source
const ( PermLevelUpload = 1 PermLevelUser = 2 PermLevelAdmin = 10 )
View Source
const DefaultContentSizeLimit = 34_000_000_000
Variables ¶
View Source
var DefaultHashFunction = uint64(mh.SHA2_256)
Functions ¶
func AppVersionMiddleware ¶
func AppVersionMiddleware(appVersion string) echo.MiddlewareFunc
func CalculateCarSize ¶
func CidIsUnwalkable ¶
func CidIsUnwalkable(c cid.Cid) bool
func DirsFromPath ¶
DirsFromPath splits a path into a list of directories
func EnsurePathIsLinked ¶
func EnsurePathIsLinked(dirs []string, rootNode *merkledag.ProtoNode, ds format.DAGService) (*merkledag.ProtoNode, error)
func ErrorHandler ¶
func ErrorHandler(err error, ctx echo.Context)
func ExtractAuth ¶
func ImportFile ¶
func ParseDealLabel ¶
func TransferTerminated ¶
func TransferTerminated(st *filclient.ChannelState) bool
Types ¶
type ChanTrack ¶
type ChanTrack struct { Dbid uint Last *filclient.ChannelState }
type ContentAddIpfsBody ¶
type ContentAddIpfsBody struct { ContentInCollection Root string `json:"root"` Filename string `json:"filename"` Peers []string `json:"peers"` }
type ContentAddResponse ¶
type ContentCreateBody ¶
type ContentCreateBody struct { ContentInCollection Root string `json:"root"` Name string `json:"name"` Location string `json:"location"` Type ContentType `json:"type"` }
type ContentCreateResponse ¶
type ContentCreateResponse struct {
ID uint `json:"id"`
}
type ContentInCollection ¶
type ContentType ¶
type ContentType int64
const ( Unknown ContentType = iota File Directory )
func FindCIDType ¶
func FindCIDType(ctx context.Context, root cid.Cid, dserv ipld.NodeGetter) (contentType ContentType)
FindCIDType checks if a pinned CID (root) is a file, a dir or unknown Returns dbmgr.File or dbmgr.Directory on success Returns dbmgr.Unknown otherwise
type DbCID ¶
type DbCID struct {
CID cid.Cid
}
func (DbCID) MarshalJSON ¶
func (*DbCID) UnmarshalJSON ¶
type GenericResponse ¶ added in v0.1.1
type GenericResponse struct {
Message string `json:"message"`
}
generic response models
type HttpError ¶
type HttpErrorResponse ¶ added in v0.1.1
type HttpErrorResponse struct {
Error HttpError `json:"error"`
}
type InitShuttleResponse ¶
type PeeringPeerAddMessage ¶ added in v0.1.1
type PeeringPeerAddMessage struct { Message string `json:"message"` PeersAdd []peering.PeeringPeer `json:"peers"` }
type PeeringPeerRemoveMessage ¶ added in v0.1.1
type RetrievalFailureRecord ¶
type RetrievalProgress ¶
type RetrievalProgress struct { Wait chan struct{} EndErr error }
type Shuttle ¶
type Shuttle struct { Node *node.Node Api api.Gateway DB *gorm.DB PinMgr *pinner.PinManager Filc *filclient.FilClient StagingMgr *stagingbs.StagingBSMgr GwayHandler *gateway.GatewayHandler Tracer trace.Tracer TcLk sync.Mutex TrackingChannels map[string]*ChanTrack SplitLk sync.Mutex SplitsInProgress map[uint]bool AddPinLk sync.Mutex Outgoing chan *drpc.Message Private bool DisableLocalAdding bool Dev bool Hostname string EstuaryHost string ShuttleHandle string ShuttleToken string CommpMemo *memo.Memoizer AuthCache *lru.TwoQueueCache RetrLk sync.Mutex RetrievalsInProgress map[uint]*RetrievalProgress InflightCids map[cid.Cid]uint InflightCidsLk sync.Mutex }
type ShuttleCreateContentBody ¶
type ShuttleCreateContentBody struct { ContentCreateBody Collections []string `json:"collections"` DagSplitRoot uint `json:"dagSplitRoot"` User uint `json:"user"` }
type ShuttleListResponse ¶
type ShuttleListResponse struct { Handle string `json:"handle"` Token string `json:"token"` Online bool `json:"online"` LastConnection time.Time `json:"lastConnection"` AddrInfo *peer.AddrInfo `json:"addrInfo"` Address address.Address `json:"address"` Hostname string `json:"hostname"` StorageStats *ShuttleStorageStats `json:"storageStats"` }
type ShuttleStorageStats ¶
type UserSettings ¶
type UserSettings struct { Replication int `json:"replication"` Verified bool `json:"verified"` DealDuration int `json:"dealDuration"` MaxStagingWait time.Duration `json:"maxStagingWait"` FileStagingThreshold int64 `json:"fileStagingThreshold"` ContentAddingDisabled bool `json:"contentAddingDisabled"` DealMakingDisabled bool `json:"dealMakingDisabled"` UploadEndpoints []string `json:"uploadEndpoints"` Flags int `json:"flags"` }
type ViewerResponse ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.